]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ARP: Ignore Unicast Poll messages, RFC1122.
authorRoy Marples <roy@marples.name>
Thu, 18 Apr 2019 16:01:10 +0000 (17:01 +0100)
committerRoy Marples <roy@marples.name>
Thu, 18 Apr 2019 16:01:10 +0000 (17:01 +0100)
src/arp.c

index faf8be1ca2b47f2cbba6f0377d5e3c1de9b71fc8..a501edeb674e09edbf0e322b2db9c9cd842aec05 100644 (file)
--- a/src/arp.c
+++ b/src/arp.c
@@ -239,12 +239,14 @@ arp_packet(struct interface *ifp, uint8_t *data, size_t len)
        memcpy(&arm.tha, hw_t, ar.ar_hln);
        memcpy(&arm.tip.s_addr, hw_t + ar.ar_hln, ar.ar_pln);
 
-       /* Match the ARP probe to our states */
+       /* Match the ARP probe to our states.
+        * Ignore Unicast Poll, RFC1122. */
        state = ARP_CSTATE(ifp);
        TAILQ_FOREACH_SAFE(astate, &state->arp_states, next, astaten) {
                if (IN_ARE_ADDR_EQUAL(&arm.sip, &astate->addr) ||
                    (IN_IS_ADDR_UNSPECIFIED(&arm.sip) &&
-                   IN_ARE_ADDR_EQUAL(&arm.tip, &astate->addr)))
+                   IN_ARE_ADDR_EQUAL(&arm.tip, &astate->addr) &&
+                   state->bpf_flags & BPF_BCAST))
                        arp_found(astate, &arm);
        }
 }