From: Roy Marples Date: Wed, 9 Oct 2019 10:28:03 +0000 (+0100) Subject: DHCP6: Work better with infinite addresses X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7e68001;p=thirdparty%2Fdhcpcd.git DHCP6: Work better with infinite addresses And as such just log infinite lease rather than an arbitary number. --- diff --git a/src/dhcp6.c b/src/dhcp6.c index 99531af0..1d409e76 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -2995,7 +2995,9 @@ 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 (!(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); @@ -3139,6 +3141,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", "