Mercurial > hg > dhcpcd
changeset 3274:5e0ee5ede4ee draft
When adding a static address on non IN_IFF_* systems we should still ARP
check.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Thu, 03 Sep 2015 15:06:43 +0000 |
| parents | e0918e14b3b9 |
| children | a96ee36b8905 |
| files | dhcp.c dhcpcd.c if-options.c |
| diffstat | 3 files changed, 15 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/dhcp.c Thu Sep 03 14:42:16 2015 +0000 +++ b/dhcp.c Thu Sep 03 15:06:43 2015 +0000 @@ -2221,17 +2221,20 @@ 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
--- a/dhcpcd.c Thu Sep 03 14:42:16 2015 +0000 +++ b/dhcpcd.c Thu Sep 03 15:06:43 2015 +0000 @@ -433,7 +433,7 @@ 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;
--- a/if-options.c Thu Sep 03 14:42:16 2015 +0000 +++ b/if-options.c Thu Sep 03 15:06:43 2015 +0000 @@ -810,7 +810,7 @@ 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);
