]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP: Only test not BOUND when finishing DAD
authorRoy Marples <roy@marples.name>
Tue, 30 Aug 2022 16:23:27 +0000 (17:23 +0100)
committerRoy Marples <roy@marples.name>
Tue, 30 Aug 2022 16:23:27 +0000 (17:23 +0100)
This fixes using a last lease on initial boot when the DHCP
server is not present.

src/dhcp.c

index fbed2f3ca2e2d7b7842c8c6e21be4cf80208f03a..ce3b87c8bf5d15d755d724a75f59a64ab46a44f6 100644 (file)
@@ -2005,7 +2005,7 @@ dhcp_finish_dad(struct interface *ifp, struct in_addr *ia)
 {
        struct dhcp_state *state = D_STATE(ifp);
 
-       if (state->state != DHS_PROBE)
+       if (state->state == DHS_BOUND)
                return;
        if (state->offer == NULL || state->offer->yiaddr != ia->s_addr)
                return;