]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
inet6: Support a /128 autoconf prefix from RA
authorRoy Marples <roy@marples.name>
Fri, 17 Jan 2020 13:22:57 +0000 (13:22 +0000)
committerRoy Marples <roy@marples.name>
Fri, 17 Jan 2020 13:22:57 +0000 (13:22 +0000)
This is apparently a thing. Unsure why, but heh ho.

src/ipv6.c

index c49300c11751ce7c58899b94e784a3b91dd588c7..92403912a807025c1bc37ab59a13b2a80b536fbb 100644 (file)
@@ -1554,7 +1554,9 @@ ipv6_newaddr(struct interface *ifp, const struct in6_addr *addr,
        tempaddr = false;
 #endif
 
-       if (ia->flags & IPV6_AF_AUTOCONF && !tempaddr) {
+       if (prefix_len == 128)
+               goto makepfx;
+       else if (ia->flags & IPV6_AF_AUTOCONF && !tempaddr) {
                ia->prefix = *addr;
                ia->dadcounter = ipv6_makeaddr(&ia->addr, ifp,
                                               &ia->prefix,
@@ -1570,13 +1572,12 @@ ipv6_newaddr(struct interface *ifp, const struct in6_addr *addr,
 #else
                return ia;
 #endif
-       } else if (ia->flags & (IPV6_AF_REQUEST | IPV6_AF_DELEGATEDPFX) &&
-                  prefix_len != 128)
-       {
+       } else if (ia->flags & (IPV6_AF_REQUEST | IPV6_AF_DELEGATEDPFX)) {
                ia->prefix = *addr;
                cbp = inet_ntop(AF_INET6, &ia->prefix, buf, sizeof(buf));
                goto paddr;
        } else {
+makepfx:
                ia->addr = *addr;
                if (ipv6_makeprefix(&ia->prefix,
                                    &ia->addr, ia->prefix_len) == -1)