summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
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:22:57 +0000
commit7d88d302e322d31b13af4667311f81d394780e5b (patch)
treeb8908aa703cd45975fd253a85193335e944bcd27 /src/ipv6.c
parent0ae6a6865c02af1eb9ee1b3831dbfe38d8932f1a (diff)
downloaddhcpcd-7d88d302e322d31b13af4667311f81d394780e5b.tar.xz
inet6: Support a /128 autoconf prefix from RA
This is apparently a thing. Unsure why, but heh ho.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index c49300c1..92403912 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -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)