[PATCH] interface checking ARP

Leech, Christopher (christopher.leech@intel.com)
Mon, 23 Aug 1999 08:49:18 -0700


After the discussions in the "ARP (mis)behavior" thread I decided to go
ahead and try to change the ARP behavior. It was easier than I expected,
this patch forces ARP requests to be ignored unless they are received on an
interface configured to the target IP. I'd be interested to hear if this
creates any problems - it seems to work well for me.

diff -u linux/net/ipv4/arp.c linux/net/ipv4/arp.new.c
--- linux/net/ipv4/arp.c Mon Aug 9 12:04:41 1999
+++ linux/net/ipv4/arp.new.c Mon Aug 23 08:28:24 1999
@@ -655,7 +655,8 @@
}

if (arp->ar_op == __constant_htons(ARPOP_REQUEST) &&
- ip_route_input(skb, tip, sip, 0, dev) == 0) {
+ ip_route_input(skb, tip, sip, 0, dev) == 0 &&
+ dev == ip_dev_find(tip)) {

rt = (struct rtable*)skb->dst;
addr_type = rt->rt_type;

Chris Leech
Intel Corporation
christopher.leech@intel.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/