From: Roy Marples Date: Wed, 29 Apr 2020 15:06:04 +0000 (+0000) Subject: inet6: Expire ND on the second, not after it X-Git-Tag: v9.1.0~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9efd07774ac466937fd7bbab098716a272ec6f1c;p=thirdparty%2Fdhcpcd.git inet6: Expire ND on the second, not after it Otherwise the timing is slightly confused. --- diff --git a/src/ipv6nd.c b/src/ipv6nd.c index fc84d3f5..18f6c0a5 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -647,7 +647,7 @@ ipv6nd_applyra(struct interface *ifp) }; TAILQ_FOREACH(rap, ifp->ctx->ra_routers, next) { - if (rap->iface == ifp && rap->lifetime != 0) + if (rap->iface == ifp && !rap->expired) break; } @@ -1707,7 +1707,7 @@ ipv6nd_expirera(void *arg) if (rap->lifetime) { elapsed = (uint32_t)eloop_timespec_diff(&now, &rap->acquired, NULL); - if (elapsed > rap->lifetime || rap->doexpire) { + if (elapsed >= rap->lifetime || rap->doexpire) { if (!rap->expired) { logwarnx("%s: %s: router expired", ifp->name, rap->sfrom); @@ -1736,7 +1736,7 @@ ipv6nd_expirera(void *arg) } elapsed = (uint32_t)eloop_timespec_diff(&now, &ia->acquired, NULL); - if (elapsed > ia->prefix_vltime || rap->doexpire) { + if (elapsed >= ia->prefix_vltime || rap->doexpire) { if (ia->flags & IPV6_AF_ADDED) { logwarnx("%s: expired %s %s", ia->iface->name, @@ -1817,7 +1817,7 @@ ipv6nd_expirera(void *arg) } ltime = ntohl(ltime); - if (elapsed > ltime) { + if (elapsed >= ltime) { expired = true; continue; }