Skip to content

Commit 2870767

Browse files
authored
dhcp6: start request when advertise received after IRT (#376)
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.
1 parent e3c5de1 commit 2870767

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/dhcp6.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3585,8 +3585,6 @@ dhcp6_recvif(struct interface *ifp, const char *sfrom,
35853585
if (r->type == DHCP6_ADVERTISE) {
35863586
struct ipv6_addr *ia;
35873587

3588-
if (state->state == DH6S_REQUEST) /* rapid commit */
3589-
goto bind;
35903588
TAILQ_FOREACH(ia, &state->addrs, next) {
35913589
if (!(ia->flags & (IPV6_AF_STALE | IPV6_AF_REQUEST)))
35923590
break;
@@ -3599,11 +3597,14 @@ dhcp6_recvif(struct interface *ifp, const char *sfrom,
35993597
else
36003598
loginfox("%s: ADV %s from %s",
36013599
ifp->name, ia->saddr, sfrom);
3600+
if (state->RTC > 1) {
3601+
// IRT already elapsed, initiate request
3602+
dhcp6_startrequest(ifp);
3603+
}
36023604
// We will request when the IRT elapses
36033605
return;
36043606
}
36053607

3606-
bind:
36073608
dhcp6_bind(ifp, op, sfrom);
36083609
}
36093610

0 commit comments

Comments
 (0)