summaryrefslogtreecommitdiff
path: root/src/network/networkd-ndisc.c
AgeCommit message (Collapse)Author
2016-11-02networkd: flush DNSSL/RDNSS lists when we lose carrierLennart Poettering
Fixes: #3870
2016-11-02netword: minor memory leak fixLennart Poettering
2016-10-24networkd-ndisc: Don't add NDisc route for local address (#4467)Patrik Flykt
When systemd-networkd is run on the same IPv6 enabled interface where radvd is announcing prefixes, a route is being set up pointing to the interface address. As this will fail with an invalid argument error, the link is marked as failed and the following message like the following will appear in in the logs: systemd-networkd[21459]: eth1: Could not set NDisc route or address: Invalid argument systemd-networkd[21459]: eth1: Failed Should the interface be required by systemd-networkd-wait-online, network-online.target will wait until its timeout hits thereby significantly delaying system startup. The fix is to check whether the gateway address obtained from NDisc messages is equal to any of the interface addresses on the same link and not set the NDisc route in that case.
2016-09-19networkd: Allow specifying RouteTable for RAsJason Kölker
2016-07-14network-ndisc: avoid VLAs (#3725)Daniel Mack
Do not allocate objects of dynamic and potentially large size on the stack to avoid both clang compilation errors and unpredictable runtime behavior on exotic platforms. Use the heap for that instead. While at it, refactor the code a bit. Access 's->domain' via NDISC_DNSSL_DOMAIN(), and refrain from allocating 'x' independently, but rather reuse 's' if we're dealing with a new entry to the set. Fixes #3717
2016-06-06network: beef up ipv6 RA support considerablyLennart Poettering
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more comprehensively. Since the API is extended quite a bit networkd has been ported over too, and the patch is not as straight-forward as one could wish. The rework includes: - Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two new configuration options have been added to networkd to make this configurable. - sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA message, and has direct, friendly acessor functions for the singleton RA properties, as well as an iterative interface to iterate through known and unsupported options. The router object may either be retrieved from the wire, or generated from raw data. In many ways the sd-ndisc API now matches the sd-lldp API, except that no implicit database of seen data is kept. (Note that sd-ndisc actually had a half-written, but unused implementaiton of such a store, which is removed now.) - sd-ndisc will now collect the reception timestamps of RA, which is useful to make sd_ndisc_router fully descriptive of what it covers. Fixes: #1079
2016-06-06networkd: remove unused variable (#3447)Tobias Jungel
this patch solves the following waring: ../src/network/networkd-ndisc.c:197:13: warning: unused variable ‘r’ [-Wunused-variable] int r; fixes acac5b2f
2016-06-02networkd-ndisc: do not start DHCPv6 when after NDISC timeoutTom Yan
For it's silly and unnecessary. Although it was apparently mandated by RFC 2462 in [5.5.2. Absence of Router Advertisements], that has been changed in the same section of RFC 4862, which obsoleted the former RFC.
2016-06-01networkd-dhcp6: generalize DHCPv6 client (re)startingTom Yan
dhcp6_request_address() was merely a function to switch the DHCPv6 client from "stateless" mode to "stateful" mode. It was also a one-way switch. Also, to (re)start the client, we would need to repeat separate function calls. In this patch, dhcp6_request_address() is made a general starter/manager of the DHCPv6 client. It now takes an extra parameter so we will be specifying which mode the DHCPv6 client should be started in. Also it will keep track of the current mode and compare with the newly requested mode, and only restart the client in case there is a difference between them. This also makes sure that the DHCPv6 client will be (re)started accordingly as per the Router Advertisement flags.
2016-05-26sd-network: rename "index" field of the various clients to "ifindex"Lennart Poettering
A field "index" is not particularly precise and also might conflict with libc's index() function definition. Also, pretty much everywhere else we call this concept "ifindex", including in networkd, the primary user of these libraries. Hence, let's fix this up and call this "ifindex" everywhere here too.
2016-05-21networkd-ndisc: do not return value from void functionsystemd/v230Zbigniew Jędrzejewski-Szmek
Fixup for #3304. Only warn, and not return, because that's what sd_dhcp6_client_start() does right below the call to sd_dhcp6_client_set_local_address().
2016-05-20[networkd-ndisc] set IPv6LL address in DHCP clienttomty89
Fix issue #3256 and probably #1982. Referenced link_acquire_ipv6_conf() in networkd-link.c.
2016-04-29networkd: rework headers to avoid circular includesZbigniew Jędrzejewski-Szmek
Header files were organized in a way where the includer would add various typedefs used by the includee before including it, resulting in a tangled web of dependencies between files. Replace this with the following logic: networkd.h / \ networkd-link.h \ networkd-ipv4ll.h--\__\ networkd-fdb.h \ networkd-network.h netword-netdev-*.h networkd-route.h \ networkd-netdev.h If a pointer to a structure defined in a different header file is needed, use a typedef line instead of including the whole header.
2016-02-22tree-wide: make ++/-- usage consistent WRT spacingVito Caputo
Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
2016-02-18Don't use internal struct member namesNathan McSween
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-01-16Fix IPv6PrivacyExtension (networkd-ndisc.c)Dominik Hannen
This small addition fixes the issues #1982 and #2242. IPv6PrivacyExtension now works as expected even when a RA is received.
2015-11-19Revert "networkd: ndisc - revert to letting the kernel handle NDisc"Tom Gundersen
This reverts commit 23f186494cf041107896fc4bd7fc5b8f921fd79f. The bug has now been fixed, so we can go back to managing this ourselves.
2015-11-18networkd: ndisc - revert to letting the kernel handle NDiscTom Gundersen
There is still a bug in the userspace version, so temporarily revert this. This is a work-around for issue #1866.
2015-11-17Merge pull request #1920 from teg/networkd-fixesMartin Pitt
networkd fixes
2015-11-17networkd: ndisc - consider configured on timeoutTom Gundersen
Don't block indefinitely, when control has been passed on from NDisc to DHCPv6. In this case there is likely no IPv6 support on the local link, so otherwise this would block indefinitely.
2015-11-17networkd: ndisc - fix token supportTom Gundersen
Fixes CID#1338680. Thanks to Thomas Andersen.
2015-11-16networkd: ndisc/dhcpv6 - handle starting running clientsTom Gundersen
The clients may be triggered to be started repeatedly without being stopped first, simply swallow the error rather than failing the link.
2015-11-11networkd: ndisc - handle router advertisement in userspaceTom Gundersen
Router Discovery is a core part of IPv6, which by default is handled by the kernel. However, the kernel implementation is meant as a fall-back, and to fully support the protocol a userspace implementation is desired. The protocol essentially listens for Router Advertisement packets from routers on the local link and use these to configure the client automatically. The four main pieces of information are: what kind (if any) of DHCPv6 configuration should be performed; a default gateway; the prefixes that should be considered to be on the local link; and the prefixes with which we can preform SLAAC in order to pick a global IPv6 address. A lot of additional information is also available, which we do not yet fully support, but which will eventually allow us to avoid the need for DHCPv6 in the common case. Short-term, the reason for wanting this is in userspace was the desire to fully track all the addresses on links we manage, and that is not possible for addresses managed by the kernel (as the kernel does not expose to us the fact that it manages these addresses). Moreover, we would like to support stable privacy addresses, which will soon be mandated and the legacy MAC-based global addresses deprecated, to do this well we need to handle the generation in userspace. Lastly, more long-term we wish to support more RA options than what the kernel exposes.
2015-11-11networkd: IPv6 router discovery - follow IPv6AcceptRouterAdvertisemnt=Tom Gundersen
The previous behavior: When DHCPv6 was enabled, router discover was performed first, and then DHCPv6 was enabled only if the relevant flags were passed in the Router Advertisement message. Moreover, router discovery was performed even if AcceptRouterAdvertisements=false, moreover, even if router advertisements were accepted (by the kernel) the flags indicating that DHCPv6 should be performed were ignored. New behavior: If RouterAdvertisements are accepted, and either no routers are found, or an advertisement is received indicating DHCPv6 should be performed, the DHCPv6 client is started. Moreover, the DHCP option now truly enables the DHCPv6 client regardless of router discovery (though it will probably not be very useful to get a lease withotu any routes, this seems the more consistent approach). The recommended default setting should be to set DHCP=ipv4 and to leave IPv6AcceptRouterAdvertisements unset.
2015-11-11networkd: dhcp6 - split up configure() methodTom Gundersen
Enabling address acquisition, configuring the client and starting the client are now split out. This to better handle the client being repeatedly enabled due to router advertisements.
2015-11-11sd-ndisc: introduce separate callbacksTom Gundersen
As the data passed is very different, we introduce four different callbacks: - Generic - router discovery timed out or state machine stopped - Router - router and link configuration received - Prefix onlink - configuration for an onlink prefix received - Prefix autonomous - configuration for to configure a SLAAC address for a prefix received
2015-11-11sd-ndisc: notify user on STOPTom Gundersen
Also, stop the state machine when we get into a broken state, rather than just notify the user.
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-10-22sd-ndisc: don't inform the caller of expired prefixesTom Gundersen
The caller should push any lifetime information into the kernel and let the kernel handle prefix expiration.
2015-10-22networkd: dhcp6 - do not handle prefix expirationTom Gundersen
This ressurects 47d45d3cde45d6545367570264e4e3636bc9e345. We now always use /128 prefixes, so there is no need for the DHCPv6 code to know about prefixes expiring.
2015-10-22networkd: ndisc - split out from dhcp6 codeTom Gundersen