diff options
| author | Roy Marples <roy@marples.name> | 2020-03-31 22:00:52 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-03-31 22:00:52 +0100 |
| commit | 8d9b31b328b324a4a8beaa8f64da34326e5da6a7 (patch) | |
| tree | 5279314c5db7fc3aea42f19052b8b9cd983e204c /src/ipv6nd.c | |
| parent | fc6c3b857aa5ca56ab0f155b9ecec7e1d8080746 (diff) | |
| download | dhcpcd-8d9b31b328b324a4a8beaa8f64da34326e5da6a7.tar.xz | |
ND: Only deprecate prefixes when all stale
Diffstat (limited to 'src/ipv6nd.c')
| -rw-r--r-- | src/ipv6nd.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 21a35889..ca5f4335 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -1010,9 +1010,9 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct nd_opt_mtu mtu; struct nd_opt_rdnss rdnss; uint8_t *p; - struct ra *rap; + struct ra *rap, *rap2; struct in6_addr pi_prefix; - struct ipv6_addr *ia; + struct ipv6_addr *ia, *ia2; struct dhcp_opt *dho; bool new_rap, new_data, has_address; uint32_t old_lifetime; @@ -1362,6 +1362,21 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, TAILQ_FOREACH(ia, &rap->addrs, next) { if (!(ia->flags & IPV6_AF_STALE) || ia->prefix_pltime == 0) continue; + TAILQ_FOREACH(rap2, ctx->ra_routers, next) { + if (rap2->expired) + continue; + TAILQ_FOREACH(ia2, &rap2->addrs, next) { + if (IN6_ARE_ADDR_EQUAL(&ia->prefix, + &ia2->prefix) && + ia->prefix_pltime != 0 && + ia->prefix_vltime != 0) + break; + } + if (ia2 != NULL) + break; + } + if (rap2 != NULL && ia2 != NULL) + continue; logdebugx("%s: %s: became stale", ifp->name, ia->saddr); ia->prefix_pltime = 0; } |
