]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
IPv4LL: Ensure we pick another address on DAD conflict via ARP
authorRoy Marples <roy@marples.name>
Tue, 1 Oct 2019 17:41:15 +0000 (18:41 +0100)
committerRoy Marples <roy@marples.name>
Tue, 1 Oct 2019 17:41:15 +0000 (18:41 +0100)
While here correct an error diagnostic logging an system error too.

src/ipv4ll.c

index 4b0038b76f53275adcde301a79471733059b0c60..f893718918a027a9026a53d626462d34861c21f3 100644 (file)
@@ -263,7 +263,7 @@ ipv4ll_found(struct interface *ifp)
 
        arp_cancel(state->arp);
        if (++state->conflicts == MAX_CONFLICTS)
-               logerr("%s: failed to acquire an IPv4LL address",
+               logerrx("%s: failed to acquire an IPv4LL address",
                    ifp->name);
        eloop_timeout_add_sec(ifp->ctx->eloop,
            state->conflicts >= MAX_CONFLICTS ?
@@ -308,6 +308,7 @@ ipv4ll_found_arp(struct arp_state *astate, __unused const struct arp_msg *amsg)
        struct ipv4ll_state *state = IPV4LL_STATE(ifp);
 
        assert(state->arp == astate);
+       state->pickedaddr.s_addr = INADDR_ANY;
        ipv4ll_found(ifp);
 }