]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Make this easier to read.
authorRoy Marples <roy@marples.name>
Sat, 16 May 2015 10:11:00 +0000 (10:11 +0000)
committerRoy Marples <roy@marples.name>
Sat, 16 May 2015 10:11:00 +0000 (10:11 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index a8edf3eb75b6c5081795d44711f13a0c1b3020b8..9280eb37744f1903bbe082b988262b3d47cee558 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -2763,31 +2763,36 @@ dhcp_handledhcp(struct interface *ifp, struct dhcp_message **dhcpp,
        eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
        astate = NULL;
 
-#ifndef IN_IFF_TENTATIVE
+#ifdef IN_IFF_TENTATIVE
+       addr.s_addr = state->offer->yiaddr;
+       astate = arp_new(ifp, &addr);
+       if (astate) {
+               astate->probed_cb = dhcp_arp_probed;
+               astate->conflicted_cb = dhcp_arp_conflicted;
+               /* No need to start the probe as we'll
+                * listen to the kernel stating DAD or not and
+                * that action look look for our ARP state  for
+                * what to do. */
+       }
+#else
        if (ifo->options & DHCPCD_ARP
            && state->addr.s_addr != state->offer->yiaddr)
-#endif
        {
                addr.s_addr = state->offer->yiaddr;
-#ifndef IN_IFF_TENTATIVE
                /* If the interface already has the address configured
                 * then we can't ARP for duplicate detection. */
                ia = ipv4_findaddr(ifp->ctx, &addr);
                if (ia) {
-#endif
                        astate = arp_new(ifp, &addr);
                        if (astate) {
                                astate->probed_cb = dhcp_arp_probed;
                                astate->conflicted_cb = dhcp_arp_conflicted;
-#ifndef IN_IFF_TENTATIVE
                                arp_probe(astate);
-#endif
                        }
-#ifndef IN_IFF_TENTATIVE
                        return;
                }
-#endif
        }
+#endif
 
        dhcp_bind(ifp, astate);
 }