Skip to content

Commit

Permalink
DHCP6: lastlease behavior after Confim non-response
Browse files Browse the repository at this point in the history
If lastlease is enabled, and dhcpcd is unable to confirm its prior
lease, after timeout, bind the lease and move to the REBIND state.
Confine lastlease behavior to the CONFIRM and REBIND states.
  • Loading branch information
Jon Franklin committed Oct 23, 2024
1 parent d97fe02 commit a28b875
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dhcp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ static const char * const dhcp6_statuses[] = {

static void dhcp6_bind(struct interface *, const char *, const char *);
static void dhcp6_failinform(void *);
static void dhcp6_startrebind(void *arg);
static void dhcp6_recvaddr(void *, unsigned short);
static void dhcp6_startdecline(struct interface *);
static void dhcp6_startrequest(struct interface *);
Expand Down Expand Up @@ -1760,8 +1761,12 @@ dhcp6_fail(struct interface *ifp, bool drop)
dhcp_unlink(ifp->ctx, state->leasefile);
dhcp6_addrequestedaddrs(ifp);
eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
} else if (state->recv && ifp->options->options & DHCPCD_LASTLEASE) {
} else if ((state->state == DH6S_CONFIRM || state->state == DH6S_REBIND) &&
ifp->options->options & DHCPCD_LASTLEASE) {
dhcp6_bind(ifp, NULL, NULL);
state->state = DH6S_REBIND;
dhcp6_startrebind(ifp);
return;
} else if (state->new) {
script_runreason(ifp, "TIMEOUT6");
// We need to keep the expire timeout alive
Expand Down

0 comments on commit a28b875

Please sign in to comment.