]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Send gratuitous ARP each time we apply our IP address.
authorRoy Marples <roy@marples.name>
Tue, 15 Dec 2015 22:51:36 +0000 (22:51 +0000)
committerRoy Marples <roy@marples.name>
Tue, 15 Dec 2015 22:51:36 +0000 (22:51 +0000)
dhcp.c
ipv4.c

diff --git a/dhcp.c b/dhcp.c
index 274db05a14c269179e761818ecb8f831a3b4dacd..c75ba5523c611dfed679dd832e12a8a7d569c9a6 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1936,8 +1936,6 @@ dhcp_arp_probed(struct arp_state *astate)
        if (astate->iface->ctx->options & DHCPCD_FORKED)
                return;
 
-       arp_announce(astate);
-
        /* Stop IPv4LL now we have a working DHCP address */
        ipv4ll_drop(astate->iface);
 
diff --git a/ipv4.c b/ipv4.c
index a3a4f737aea97529054f1ae0a89772797bc13f24..fcc9b2e00e6ca066f0368a4b247d18ce1ff301af 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -1166,6 +1166,13 @@ ipv4_applyaddr(void *arg)
         * notification right now via our link socket. */
        if_initrt(ifp);
        ipv4_buildroutes(ifp->ctx);
+       /* Announce the address */
+       if (ifo->options & DHCPCD_ARP) {
+               struct arp_state *astate;
+
+               if ((astate = arp_new(ifp, &state->addr)) != NULL)
+                       arp_announce(astate);
+       }
        if (state->state == DHS_BOUND) {
                script_runreason(ifp, state->reason);
                dhcpcd_daemonise(ifp->ctx);