From: Roy Marples Date: Thu, 3 Sep 2015 15:06:43 +0000 (+0000) Subject: When adding a static address on non IN_IFF_* systems we should still ARP X-Git-Tag: v6.9.3~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10e160299d0fe18cb3e8472392544ec9cf2f99da;p=thirdparty%2Fdhcpcd.git When adding a static address on non IN_IFF_* systems we should still ARP check. --- diff --git a/dhcp.c b/dhcp.c index 69a7ec96..5162662d 100644 --- 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 diff --git a/dhcpcd.c b/dhcpcd.c index 9ea6c7ad..0e5afdbc 100644 --- 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; diff --git a/if-options.c b/if-options.c index a74fd131..57ccbbad 100644 --- a/if-options.c +++ b/if-options.c @@ -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);