summaryrefslogtreecommitdiffstats
path: root/src/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-29 15:06:04 +0000
committerRoy Marples <roy@marples.name>2020-04-29 15:06:04 +0000
commitb38ba89bea76ef8166db19f6b0e3e967c46b9203 (patch)
tree4a7306e0002115e724aa446a2a32336abe6ae72d /src/ipv6nd.c
parent40bf76d4599abfb56798379227ec7fe5d070b712 (diff)
downloaddhcpcd-b38ba89bea76ef8166db19f6b0e3e967c46b9203.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.c8
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;
}