changeset 4455:767d7b8a78cb draft

ARP: Ignore Unicast Poll messages, RFC1122.
author Roy Marples <roy@marples.name>
date Thu, 18 Apr 2019 17:01:10 +0100
parents 1037d1e35cd8
children 101b31471d89
files src/arp.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/arp.c	Thu Apr 18 16:56:34 2019 +0100
+++ b/src/arp.c	Thu Apr 18 17:01:10 2019 +0100
@@ -239,12 +239,14 @@
 	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);
 	}
 }