diff options
| author | Roy Marples <roy@marples.name> | 2020-04-29 15:06:04 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-04-29 15:06:04 +0000 |
| commit | 9efd07774ac466937fd7bbab098716a272ec6f1c (patch) | |
| tree | 4a7306e0002115e724aa446a2a32336abe6ae72d /src/ipv6nd.c | |
| parent | 8d885c0fbb7e3c55671b77649b9025bc7b7307f0 (diff) | |
| download | dhcpcd-9efd07774ac466937fd7bbab098716a272ec6f1c.tar.xz | |
inet6: Expire ND on the second, not after it
Otherwise the timing is slightly confused.
Diffstat (limited to 'src/ipv6nd.c')
| -rw-r--r-- | src/ipv6nd.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |
