summaryrefslogtreecommitdiff
path: root/src/network/networkd-dhcp6.c
AgeCommit message (Collapse)Author
2015-11-17networkd: ndisc - always configure dhcp6 clientTom Gundersen
The ndisc client may trigger the dhcpv6 client to be started (this is the common case), so we should allocate the dhcpv6 client whenever we allocate the ndisc one.
2015-11-15network: dhcp6 - fix mem leakThomas Hindoe Paaboel Andersen
from 7a695d8e CID#1338679
2015-11-13networkd: dhcp6 - don't log about losing a lease we never hadTom Gundersen
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-10-24sd-*.h: clean up exported (or to-be-exported) header filesLennart Poettering
Exported header files should not include internal headers. Fix that. Exported header files should not use the bool type. So far we opted to stick to C89 for exported headers, and hence use "int" for bools in them. Continue to do so. Exported header files should have #include lines for everything they use including inttypes.h and sys/types.h, so that they may be included in any order. Exported header files should have C++ guards, hence add them. Exported header files should not use gcc extensions like #pragma once, get rid of it.
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-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: dhcp6 - DHCPv6 addresses should always be /128Tom Gundersen
The routing information should be configured separately by ND, there is no need to indicate the prefix again in the DHCPv6 addresses. See discussion and related links at issue #1520.
2015-10-22networkd: ndisc - split out from dhcp6 codeTom Gundersen
2015-10-22networkd: ndisc - make logging messages uniformTom Gundersen
Refer to Router Discovery rather than ICMPv6.
2015-10-22networkd: rename icmp6 to ndiscTom Gundersen
2015-10-22sd-ndisc: rename API from sd-icmp6-ndTom Gundersen
2015-10-22sd-icmp6-nd: rename files to sd-ndiscTom Gundersen
The actual code rename will follow. The reason for the change of name is to make it simpler and more uniform with how we name other libraries (we don't include the underlying protocol). The new name also matches the naming in the kernel (which is particularly relevent here as we expect to let the kernel do some parts of the protocol and we do others).
2015-10-21networkd: address - merge _change() into _configure()Tom Gundersen
These functions are almost entirely the same, so avoid duplication.
2015-10-21networkd: address - factor out address_update()Tom Gundersen
Call back into link_check_ready() whenever an address state change may have made a link ready.
2015-10-21networkd: link - only consider configured when all addresses are readyTom Gundersen
We were considering a link configured whilst its IPv6 addresses were still tentative. Fixes issue #650.
2015-10-11networkd: address - process in manager.c rather than link.cTom Gundersen
2015-10-11networkd: route/address - simplify and unify creatorsTom Gundersen
Rename new_dynamic() to simply _new() and reuse that from new_static().
2015-09-30tree-wide: remove a number of invocations of strerror() and replace by %mLennart Poettering
Let's clean up our tree a bit, and reduce invocations of the thread-unsafe strerror() by replacing it with printf()'s %m specifier.
2015-09-23networkd: Wait for DHCPv6 before announcing link configuredPatrik Flykt
Wait until DHCPv6 has acquired an address before announcing the link to be configured. Log the DHCPv6 lease lost event.
2015-09-23sd-dhcp6-client: Properly handle DHCPv6 client restart after resumePatrik Flykt
Whenever a Router Advertisement is received, dhcp6_configure() will be called. A Router Advertisment can also instruct DHCPv6 to start acquiring IPv6 addresses in manged mode, if it previously was handling only other information. As an Router Advertisment is also received after the DHCPv6 client has resumed from a suspend, fix the function not to assume DHCPv6 is currently running, but instead try to restart it. Handle sd_dhcp6_start() returning -EALREADY indicating that the DHCPv6 client was already running. Collect all client unrefs in one place to unclutter the error handling. Fixes https://github.com/systemd/systemd/issues/963
2015-09-22sd-icmp6-nd: fix namespacingDavid Herrmann
Prefix all exported constants by SD_ICMP6_ND_* to avoid any namespacing conflicts.
2015-09-22sd-dhcp6: fix namespacingDavid Herrmann
Prefix all exported constants with SD_DHCP6_CLIENT_* to avoid any namespacing conflicts.
2015-06-13sd-netlink: rename from sd-rtnlTom Gundersen
2015-05-11core,network: major per-object logging reworkLennart Poettering
This changes log_unit_info() (and friends) to take a real Unit* object insted of just a unit name as parameter. The call will now prefix all logged messages with the unit name, thus allowing the unit name to be dropped from the various passed romat strings, simplifying invocations drastically, and unifying log output across messages. Also, UNIT= vs. USER_UNIT= is now derived from the Manager object attached to the Unit object, instead of getpid(). This has the benefit of correcting the field for --test runs. Also contains a couple of other logging improvements: - Drops a couple of strerror() invocations in favour of using %m. - Not only .mount units now warn if a symlinks exist for the mount point already, .automount units do that too, now. - A few invocations of log_struct() that didn't actually pass any additional structured data have been replaced by simpler invocations of log_unit_info() and friends. - For structured data a new LOG_UNIT_MESSAGE() macro has been added, that works like LOG_MESSAGE() but prefixes the message with the unit name. Similar, there's now LOG_LINK_MESSAGE() and LOG_NETDEV_MESSAGE(). - For structured data new LOG_UNIT_ID(), LOG_LINK_INTERFACE(), LOG_NETDEV_INTERFACE() macros have been added that generate the necessary per object fields. The old log_unit_struct() call has been removed in favour of these new macros used in raw log_struct() invocations. In addition to removing one more function call this allows generated structured log messages that contain two object fields, as necessary for example for network interfaces that are joined into another network interface, and whose messages shall be indexed by both. - The LOG_ERRNO() macro has been removed, in favour of log_struct_errno(). The latter has the benefit of ensuring that %m in format strings is properly resolved to the specified error number. - A number of logging messages have been converted to use log_unit_info() instead of log_info() - The client code in sysv-generator no longer #includes core code from src/core/. - log_unit_full_errno() has been removed, log_unit_full() instead takes an errno now, too. - log_unit_info(), log_link_info(), log_netdev_info() and friends, now avoid double evaluation of their parameters
2015-05-04network: Implement fallback DHCPv6 prefix handling for older kernelsPatrik Flykt
When setting IPv6 addresses acquired by DHCPv6, systemd-networkd sets the IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. As the flag and the attribute are present starting with Linux 3.14, older kernels will need systemd-network to manage prefix route expiry. By default, DHCPv6 addresses are first assigned setting the IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. Should the address assignment fail, the same assignment is tried without the IFA_FLAGS attribute. Should also the second attempt fail, an error is printed and address assignment ends with failure. As successful use of the IFA_FLAGS netlink attribute is recorded in the Link structure, the DHCPv6 code will know if the kernel or systemd-network fallback code handles expiring prefixes. The prefix expiration and IPv6 address updating fallback code is resurrected from the parts deleted with commit 47d45d3cde45d6545367570264e4e3636bc9e345. This patch can be removed once the minimum kernel requirements are greater than or equal to 3.14.
2015-03-27networkd-dhcp6: Do not handle prefix expiryPatrik Flykt
Expiring prefixes need not be handled anymore as the kernel has been instructed not to create routes for DHCPv6 assigned addresses via the IFA_F_NOPREFIXROUTE flag.
2015-03-27systemd-networkd: Use IFA_F_NOPREFIXROUTE with IPv6 addressesPatrik Flykt
The IFA_F_NOPREFIXROUTE flag prevents the kernel from creating new onlink prefixes when a DHCPv6 IPv6 address with a prefix length is set from user space. IPv6 routing will follow the onlink status from Router Advertisment Prefix Information options or any manually set route, which is the correct thing to do. As this flag has a larger value than what fits into an unsigned char, update the flag attribute to an uint32_t and set it with an IFA_FLAGS attribute when writing netlink messages to the kernel.
2015-01-27networkd-dhcp6: Assign DHCPv6 addresses and prefix lengthsPatrik Flykt
Once IPv6 addresses have been acquired, assign these to the interface with the prefix lengths taken from the ICMPv6 Router Advertisement handling code. The preferred and valid IPv6 address lifetimes are handed to the kernel which will clean up them if not renewed in time. When a prefix announced via Router Advertisements expires, find all addresses that match that prefix and update the address to have a prefix length of 128 causing the prefix to be off-link.
2014-12-10networkd-dhcp6: Support ICMPv6 Other informationPatrik Flykt
When ICMPv6 Other information is received, enable Information request in DHCPv6. If the DHCPv6 client already exists, only update the client if there is a transition from Other to Managed state.
2014-12-10networkd-dhcp6: Move ICMPv6 and DHCPv6 configuration to new filePatrik Flykt
Handle all aspects of ICMPv6 and DHCPv6 in a file of its own as is done with DHCPv4 and IPv4LL.