From 851c9f82736c89d423b244a292e153ec7124d309 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Mon, 2 Feb 2015 13:13:17 +0200 Subject: 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. --- src/network/networkd-dhcp6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/network/networkd-dhcp6.c') diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index bcfad4c03f..283a7d6992 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -65,7 +65,9 @@ static int dhcp6_address_update(Link *link, struct in6_addr *ip6_addr, addr->family = AF_INET6; memcpy(&addr->in_addr.in6, ip6_addr, sizeof(*ip6_addr)); - addr->prefixlen = prefixlen; + + addr->flags = IFA_F_NOPREFIXROUTE; + addr->prefixlen = 64; addr->cinfo.ifa_prefered = lifetime_preferred; addr->cinfo.ifa_valid = lifetime_valid; -- cgit v1.2.3-54-g00ecf