]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/network/networkd-link.c
network: Implement fallback DHCPv6 prefix handling for older kernels
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 10 Apr 2015 11:03:18 +0000 (14:03 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 4 May 2015 06:42:37 +0000 (09:42 +0300)
commitbe3a09b7ffe62b52658e77ae4d6638d1b0dae654
treeba98350ead4b1b638cc2dba86640db2ffc7d70da
parent336b5c615e9c101476784b32df1b86aaeac96431
network: Implement fallback DHCPv6 prefix handling for older kernels

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.
src/network/networkd-address.c
src/network/networkd-dhcp6.c
src/network/networkd-link.c
src/network/networkd-link.h