Skip to content

Commit

Permalink
dhcp6: start request when advertise received after IRT (#376)
Browse files Browse the repository at this point in the history
After the initial solicit timeout, any received advertisements trigger
a request.  However, after the timeout, any advertisements will
never result in a request, and the client sends solicits forever.

This patch adds sends a request in response to an advertise if the
initial timeout has expired.

Cleanup: removes a check for an impossible state.
  • Loading branch information
sshambar authored Oct 8, 2024
1 parent e3c5de1 commit 2870767
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dhcp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -3585,8 +3585,6 @@ dhcp6_recvif(struct interface *ifp, const char *sfrom,
if (r->type == DHCP6_ADVERTISE) {
struct ipv6_addr *ia;

if (state->state == DH6S_REQUEST) /* rapid commit */
goto bind;
TAILQ_FOREACH(ia, &state->addrs, next) {
if (!(ia->flags & (IPV6_AF_STALE | IPV6_AF_REQUEST)))
break;
Expand All @@ -3599,11 +3597,14 @@ dhcp6_recvif(struct interface *ifp, const char *sfrom,
else
loginfox("%s: ADV %s from %s",
ifp->name, ia->saddr, sfrom);
if (state->RTC > 1) {
// IRT already elapsed, initiate request
dhcp6_startrequest(ifp);
}
// We will request when the IRT elapses
return;
}

bind:
dhcp6_bind(ifp, op, sfrom);
}

Expand Down

0 comments on commit 2870767

Please sign in to comment.