]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcp6: start request when advertise received after IRT (#376)
authorScott Shambarger <github@shambarger.net>
Tue, 8 Oct 2024 13:26:04 +0000 (06:26 -0700)
committerGitHub <noreply@github.com>
Tue, 8 Oct 2024 13:26:04 +0000 (14:26 +0100)
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.

src/dhcp6.c

index ee24b23312c68eee219d9c0de2108ba84078e55a..9c875a1a4155ba8a0d31401316186d6c0c620bc4 100644 (file)
@@ -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;
@@ -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);
 }