]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
When adding a static address on non IN_IFF_* systems we should still ARP
authorRoy Marples <roy@marples.name>
Thu, 3 Sep 2015 15:06:43 +0000 (15:06 +0000)
committerRoy Marples <roy@marples.name>
Thu, 3 Sep 2015 15:06:43 +0000 (15:06 +0000)
check.

dhcp.c
dhcpcd.c
if-options.c

diff --git a/dhcp.c b/dhcp.c
index 69a7ec96cb265cc217fafb30f8f500a13fab6a7a..5162662dc95cb7ee665bc0bccd798da638bcbad9 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -2221,17 +2221,20 @@ dhcp_arp_bind(struct interface *ifp)
                return;
        }
 #else
-       if (ifp->options->options & DHCPCD_ARP) {
-               if (ia == NULL) {
-                       if ((astate = arp_new(ifp, &addr)) != NULL) {
-                               astate->probed_cb = dhcp_arp_probed;
-                               astate->conflicted_cb = dhcp_arp_conflicted;
-                               astate->announced_cb = dhcp_arp_announced;
-                               /* We need to handle DAD. */
-                               arp_probe(astate);
-                       }
-                       return;
+       if (ifp->options->options & DHCPCD_ARP && ia == NULL) {
+               struct dhcp_lease l;
+
+               get_lease(ifp->ctx, &l, state->offer);
+               logger(ifp->ctx, LOG_INFO, "%s: probing static address %s/%d",
+                   ifp->name, inet_ntoa(l.addr), inet_ntocidr(l.net));
+               if ((astate = arp_new(ifp, &addr)) != NULL) {
+                       astate->probed_cb = dhcp_arp_probed;
+                       astate->conflicted_cb = dhcp_arp_conflicted;
+                       astate->announced_cb = dhcp_arp_announced;
+                       /* We need to handle DAD. */
+                       arp_probe(astate);
                }
+               return;
        }
 #endif
 
index 9ea6c7ad7eb5c26227dccd605a535a43f34cc971..0e5afdbc0a95d4043f70b0bf70e00f3f401456a7 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -433,7 +433,7 @@ configure_interface1(struct interface *ifp)
                ifo->options |= DHCPCD_STATIC;
        if (ifp->flags & IFF_NOARP ||
            ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC))
-               ifo->options &= ~(DHCPCD_ARP | DHCPCD_IPV4LL);
+               ifo->options &= ~DHCPCD_IPV4LL;
        if (ifp->flags & (IFF_POINTOPOINT | IFF_LOOPBACK) ||
            !(ifp->flags & IFF_MULTICAST))
                ifo->options &= ~DHCPCD_IPV6RS;
index a74fd1316d8e85413efe423aaa21f245d8b0e196..57ccbbadd894a45a46a9fcbd8def66a288f371ae 100644 (file)
@@ -810,7 +810,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
                        ifo->req_mask.s_addr = 0;
                }
                ifo->options |= DHCPCD_INFORM | DHCPCD_PERSISTENT;
-               ifo->options &= ~(DHCPCD_ARP | DHCPCD_STATIC);
+               ifo->options &= ~DHCPCD_STATIC;
                break;
        case 't':
                ifo->timeout = (time_t)strtoi(arg, NULL, 0, 0, INT32_MAX, &e);