summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-12-12 13:59:48 +0000
committerRoy Marples <roy@marples.name>2019-12-12 13:59:48 +0000
commit6edad03dc748771dc8f64e43d7b1df50bc1f7c1b (patch)
tree6347aef2771bc296e3045e3867f9e086f68ab6e3
parentb3a62c88b91444c46ddb2150321d2e9d7d347022 (diff)
downloaddhcpcd-6edad03dc748771dc8f64e43d7b1df50bc1f7c1b.tar.xz
DHCP6: Work better with infinite addresses
And as such just log infinite lease rather than an arbitary number. Backported from d7e68001.
-rw-r--r--src/dhcp6.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dhcp6.c b/src/dhcp6.c
index 2e85f0e6..204edbe2 100644
--- a/src/dhcp6.c
+++ b/src/dhcp6.c
@@ -3021,7 +3021,10 @@ dhcp6_bind(struct interface *ifp, const char *op, const char *sfrom)
TAILQ_FOREACH(ia, &state->addrs, next) {
if (ia->flags & IPV6_AF_STALE)
continue;
- if (ia->prefix_vltime <= state->renew)
+ if (ia->prefix_vltime != 0
+ && !(state->renew == ND6_INFINITE_LIFETIME
+ && ia->prefix_vltime == ND6_INFINITE_LIFETIME)
+ && ia->prefix_vltime <= state->renew)
logwarnx(
"%s: %s will expire before renewal",
ifp->name, ia->saddr);
@@ -3165,6 +3168,8 @@ dhcp6_bind(struct interface *ifp, const char *op, const char *sfrom)
if (state->state == DH6S_INFORMED)
lognewinfo("%s: refresh in %"PRIu32" seconds",
ifp->name, state->renew);
+ else if (state->renew == ND6_INFINITE_LIFETIME)
+ lognewinfo("%s: leased for infinity", ifp->name);
else if (state->renew || state->rebind)
lognewinfo("%s: renew in %"PRIu32", "
"rebind in %"PRIu32", "