summaryrefslogtreecommitdiff
path: root/src/network/networkd-address.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2015-04-10 14:03:18 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2015-05-04 09:42:37 +0300
commitbe3a09b7ffe62b52658e77ae4d6638d1b0dae654 (patch)
treeba98350ead4b1b638cc2dba86640db2ffc7d70da /src/network/networkd-address.c
parent336b5c615e9c101476784b32df1b86aaeac96431 (diff)
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.
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r--src/network/networkd-address.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index a3aa1f7fdb..069ba3eccb 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -215,7 +215,7 @@ int address_update(Address *address, Link *link,
if (r < 0)
return log_error_errno(r, "Could not set flags: %m");
- if (address->flags & ~0xff) {
+ if (address->flags & ~0xff && link->rtnl_extended_attrs) {
r = sd_rtnl_message_append_u32(req, IFA_FLAGS, address->flags);
if (r < 0)
return log_error_errno(r, "Could not set extended flags: %m");