interface-ip: transfer prefix route ownership for deprecated ipv6addr to kernel
authorAlin Nastac <alin.nastac@gmail.com>
Wed, 5 Feb 2020 13:36:33 +0000 (14:36 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 5 Feb 2020 20:53:03 +0000 (21:53 +0100)
When netifd manages the prefix route directly, it will remove it
the moment prefix gets deprecated. This will make it impossible
for the target to send ICMPv6 errors back to LAN devices still
using the deprecated prefix, thus breaking the L-14 requirement
of RFC 7084.

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
interface-ip.c

index 91c305b6d562e26a2632a9bb801e19a982960281..ff8f2193e33d627d36cb1c5ae24360fc3e064674 100644 (file)
@@ -913,7 +913,7 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment,
 
        addr.addr.in6 = assignment->addr;
        addr.mask = assignment->length;
-       addr.flags = DEVADDR_INET6 | DEVADDR_OFFLINK;
+       addr.flags = DEVADDR_INET6;
        addr.preferred_until = prefix->preferred_until;
        addr.valid_until = prefix->valid_until;
 
@@ -960,6 +960,7 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment,
                        route.addr = addr.addr;
                }
 
+               addr.flags |= DEVADDR_OFFLINK;
                if (system_add_address(l3_downlink, &addr))
                        return;