From ef74ffdaff7638381cf79d24d0ffc5977aeecd79 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 21 Feb 2025 09:47:25 +0000 Subject: [PATCH] DHCP6: RENEW/REBIND if T1/T2 have passed at CONFIRM --- src/dhcp6.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dhcp6.c b/src/dhcp6.c index 3355cd94..7d0d318a 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -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) -- 2.47.3