From d7e6800161ea3811de8726612862e989e8983066 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 9 Oct 2019 11:28:03 +0100 Subject: [PATCH] DHCP6: Work better with infinite addresses And as such just log infinite lease rather than an arbitary number. --- src/dhcp6.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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", " -- 2.47.2