]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Discard duplicate ARP messages from other interfaces with the same address on this...
authorRoy Marples <roy@marples.name>
Fri, 10 Oct 2014 08:49:49 +0000 (08:49 +0000)
committerRoy Marples <roy@marples.name>
Fri, 10 Oct 2014 08:49:49 +0000 (08:49 +0000)
arp.c

diff --git a/arp.c b/arp.c
index eae4d58ada7f7a48ba7129a52a574aff3760d209..d79886317de20393a62e678c08275ce3dc7b337d 100644 (file)
--- a/arp.c
+++ b/arp.c
@@ -124,6 +124,7 @@ static void
 arp_packet(void *arg)
 {
        struct interface *ifp = arg;
+       const struct interface *ifn;
        uint8_t arp_buffer[ARP_LEN];
        struct arphdr ar;
        uint32_t reply_s;
@@ -170,8 +171,12 @@ arp_packet(void *arg)
                if ((hw_t + ar.ar_hln + ar.ar_pln) - arp_buffer > bytes)
                        continue;
                /* Ignore messages from ourself */
-               if (ar.ar_hln == ifp->hwlen &&
-                   memcmp(hw_s, ifp->hwaddr, ifp->hwlen) == 0)
+               TAILQ_FOREACH(ifn, ifp->ctx->ifaces, next) {
+                       if (ar.ar_hln == ifn->hwlen &&
+                           memcmp(hw_s, ifn->hwaddr, ifn->hwlen) == 0)
+                               break;
+               }
+               if (ifn)
                        continue;
                /* Copy out the IP addresses */
                memcpy(&reply_s, hw_s + ar.ar_hln, ar.ar_pln);