From: Roy Marples Date: Fri, 17 Jan 2020 13:22:57 +0000 (+0000) Subject: inet6: Support a /128 autoconf prefix from RA X-Git-Tag: v8.1.6~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8678cf30ce2004d9e8c82ea5709b56ac0eed9ff0;p=thirdparty%2Fdhcpcd.git inet6: Support a /128 autoconf prefix from RA This is apparently a thing. Unsure why, but heh ho. --- diff --git a/src/ipv6.c b/src/ipv6.c index 1e82cf0c..288f822a 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -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)