]> 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:24:03 +0000 (13:24 +0000)
This is apparently a thing. Unsure why, but heh ho.

src/ipv6.c

index 1e82cf0ca4bc8e1fb63468708af91dd1ae9a589c..288f822a9d575f21370dc2b68a9345c8f6177427 100644 (file)
@@ -1565,7 +1565,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,
@@ -1581,13 +1583,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)