]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP6: RENEW/REBIND if T1/T2 have passed at CONFIRM
authorRoy Marples <roy@marples.name>
Fri, 21 Feb 2025 09:47:25 +0000 (09:47 +0000)
committerRoy Marples <roy@marples.name>
Fri, 21 Feb 2025 09:47:25 +0000 (09:47 +0000)
src/dhcp6.c

index 3355cd940ee98abf999bb54829a278d377a1369a..7d0d318a353170baeac978ba03e4978125109fef 100644 (file)
@@ -3349,12 +3349,16 @@ dhcp6_bind(struct interface *ifp, const char *op, const char *sfrom)
                        state->state = DH6S_BOUND;
                state->failed = false;
 
-               if (state->renew && state->renew != ND6_INFINITE_LIFETIME)
+               /* If we CONFIRM we might need to enter RENEW
+                * or REBIND right away if the timers have expired */
+               if ((state->renew || (state->rebind && confirmed)) &&
+                   state->renew != ND6_INFINITE_LIFETIME)
                        eloop_timeout_add_sec(ifp->ctx->eloop,
                            state->renew,
                            state->state == DH6S_INFORMED ?
                            dhcp6_startinform : dhcp6_startrenew, ifp);
-               if (state->rebind && state->rebind != ND6_INFINITE_LIFETIME)
+               if ((state->rebind || (state->expire && confirmed)) &&
+                   state->rebind != ND6_INFINITE_LIFETIME)
                        eloop_timeout_add_sec(ifp->ctx->eloop,
                            state->rebind, dhcp6_startrebind, ifp);
                if (state->expire != ND6_INFINITE_LIFETIME)