diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2015-02-02 13:13:17 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2015-03-27 13:57:13 +0200 |
commit | 851c9f82736c89d423b244a292e153ec7124d309 (patch) | |
tree | 6f270a444a47b1d83738fa4f83d021aa89ffe0cc /src/network/networkd-link.c | |
parent | 350e7a14dd66d79cbc94f4b49b6a58ccb8a4d1c1 (diff) |
systemd-networkd: Use IFA_F_NOPREFIXROUTE with IPv6 addresses
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.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 842ca1ce6e..437c59843e 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1831,6 +1831,7 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use Link *link = NULL; uint16_t type; _cleanup_address_free_ Address *address = NULL; + unsigned char flags; Address *existing; char buf[INET6_ADDRSTRLEN], valid_buf[FORMAT_TIMESPAN_MAX]; const char *valid_str = NULL; @@ -1894,11 +1895,12 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use return 0; } - r = sd_rtnl_message_addr_get_flags(message, &address->flags); + r = sd_rtnl_message_addr_get_flags(message, &flags); if (r < 0) { log_link_warning(link, "rtnl: received address with invalid flags, ignoring"); return 0; } + address->flags = flags; switch (address->family) { case AF_INET: |