]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ARP: Linux doesn't send a Gratuitous ARP for new addresses
authorRoy Marples <roy@marples.name>
Tue, 8 Oct 2019 12:58:30 +0000 (13:58 +0100)
committerRoy Marples <roy@marples.name>
Tue, 8 Oct 2019 12:58:30 +0000 (13:58 +0100)
src/arp.c

index 55b6203bb99285a5732bf4cd3f5f630dcdc30b1f..0d5a73810cd5dda8fe30d1962a94efe2ba4ff30f 100644 (file)
--- a/src/arp.c
+++ b/src/arp.c
@@ -438,15 +438,20 @@ arp_announce1(void *arg)
                    astate->claims, ANNOUNCE_NUM);
 
        /* The kernel will send a Gratuitous ARP for newly added addresses.
-        * So we can avoid sending the same. */
+        * So we can avoid sending the same.
+        * Linux is special and doesn't send one. */
        ia = ipv4_iffindaddr(ifp, &astate->addr, NULL);
+#ifndef __linux__
        if (astate->claims == 1 && ia != NULL && ia->flags & IPV4_AF_NEW)
                goto skip_request;
+#endif
 
        if (arp_request(ifp, &astate->addr, &astate->addr) == -1)
                logerr(__func__);
 
+#ifndef __linux__
 skip_request:
+#endif
        /* No longer a new address. */
        if (ia != NULL)
                ia->flags |= ~IPV4_AF_NEW;