]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP6: Work better with infinite addresses
authorRoy Marples <roy@marples.name>
Wed, 9 Oct 2019 10:28:03 +0000 (11:28 +0100)
committerRoy Marples <roy@marples.name>
Wed, 9 Oct 2019 10:28:03 +0000 (11:28 +0100)
And as such just log infinite lease rather than an arbitary
number.

src/dhcp6.c

index 99531af03a7e278221a84291e0378a2f66d6db79..1d409e768e59f5868cfa0f105d5cfad561ac470e 100644 (file)
@@ -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", "