Skip to content

Commit ef74ffd

Browse files
committed
DHCP6: RENEW/REBIND if T1/T2 have passed at CONFIRM
1 parent f7a6397 commit ef74ffd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/dhcp6.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3349,12 +3349,16 @@ dhcp6_bind(struct interface *ifp, const char *op, const char *sfrom)
33493349
state->state = DH6S_BOUND;
33503350
state->failed = false;
33513351

3352-
if (state->renew && state->renew != ND6_INFINITE_LIFETIME)
3352+
/* If we CONFIRM we might need to enter RENEW
3353+
* or REBIND right away if the timers have expired */
3354+
if ((state->renew || (state->rebind && confirmed)) &&
3355+
state->renew != ND6_INFINITE_LIFETIME)
33533356
eloop_timeout_add_sec(ifp->ctx->eloop,
33543357
state->renew,
33553358
state->state == DH6S_INFORMED ?
33563359
dhcp6_startinform : dhcp6_startrenew, ifp);
3357-
if (state->rebind && state->rebind != ND6_INFINITE_LIFETIME)
3360+
if ((state->rebind || (state->expire && confirmed)) &&
3361+
state->rebind != ND6_INFINITE_LIFETIME)
33583362
eloop_timeout_add_sec(ifp->ctx->eloop,
33593363
state->rebind, dhcp6_startrebind, ifp);
33603364
if (state->expire != ND6_INFINITE_LIFETIME)

0 commit comments

Comments
 (0)