]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add a guard to IPv4LL probed in case of an ARP race.
authorRoy Marples <roy@marples.name>
Fri, 14 Nov 2014 07:16:49 +0000 (07:16 +0000)
committerRoy Marples <roy@marples.name>
Fri, 14 Nov 2014 07:16:49 +0000 (07:16 +0000)
ipv4ll.c

index 8cb6d2f3117ffc318c95c8a3e0b6339e274c68ac..99f78820643641db91e2294cd3d5a64d0eae5ebb 100644 (file)
--- a/ipv4ll.c
+++ b/ipv4ll.c
@@ -107,15 +107,17 @@ ipv4ll_probed(struct arp_state *astate)
        struct dhcp_state *state = D_STATE(astate->iface);
        struct dhcp_message *offer;
 
-       /* A DHCP lease could have already been offered.
-        * Backup this lease and replace once the IPv4LL addres is bound */
-       offer = state->offer;
-       state->offer = ipv4ll_make_lease(astate->addr.s_addr);
-       if (state->offer == NULL)
-               syslog(LOG_ERR, "%s: %m", __func__);
-       else
-               dhcp_bind(astate->iface, astate);
-       state->offer = offer;
+       if (state->state != DHS_BOUND) {
+               /* A DHCP lease could have already been offered.
+                * Backup and replace once the IPv4LL addres is bound */
+               offer = state->offer;
+               state->offer = ipv4ll_make_lease(astate->addr.s_addr);
+               if (state->offer == NULL)
+                       syslog(LOG_ERR, "%s: %m", __func__);
+               else
+                       dhcp_bind(astate->iface, astate);
+               state->offer = offer;
+       }
 }
 
 static void