summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-01-17 13:22:57 +0000
committerRoy Marples <roy@marples.name>2020-01-17 13:24:03 +0000
commit8678cf30ce2004d9e8c82ea5709b56ac0eed9ff0 (patch)
treed8d19d09c445bafdacfe5084433cf0357fc795ff
parent2902c75611efd862befae9a1d688161049972d75 (diff)
downloaddhcpcd-8678cf30ce2004d9e8c82ea5709b56ac0eed9ff0.tar.xz
inet6: Support a /128 autoconf prefix from RA
This is apparently a thing. Unsure why, but heh ho.
-rw-r--r--src/ipv6.c9
1 files changed, 5 insertions, 4 deletions
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)