aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2012-03-15 01:25:58 -0400
committerDavid S. Miller <davem@davemloft.net>2012-03-17 02:00:20 -0400
commit124d37e9f088a8f56494b0264d63d22555f53fef (patch)
tree372cf065963b109c0df78964ec196488a570eba5
parent1aa9bc5b2f4cf8c48944fb9a607bf1dd674e2c10 (diff)
arp: allow arp processing to honor per interface arp_accept sysctl
I found recently that the arp_process function which handles all of our received arp frames, is using IPV4_DEVCONF_ALL macro to check the state of the arp_process flag. This seems wrong, as it implies that either none or all of the network interfaces accept gratuitous arps. This patch corrects that, allowing per-interface arp_accept configuration to deviate from the all setting. Note this also brings us into line with the way the arp_filter setting is handled during arp_process execution. Tested this myself on my home network, and confirmed it works as expected. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: "David S. Miller" <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/inetdevice.h1
-rw-r--r--net/ipv4/arp.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 5f8146695b7..597f4a9f324 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -139,6 +139,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
139 IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS))) 139 IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS)))
140 140
141#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER) 141#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER)
142#define IN_DEV_ARP_ACCEPT(in_dev) IN_DEV_ORCONF((in_dev), ARP_ACCEPT)
142#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE) 143#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE)
143#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) 144#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
144#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) 145#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 63e49890ad3..73f46d691ab 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -889,7 +889,7 @@ static int arp_process(struct sk_buff *skb)
889 889
890 n = __neigh_lookup(&arp_tbl, &sip, dev, 0); 890 n = __neigh_lookup(&arp_tbl, &sip, dev, 0);
891 891
892 if (IPV4_DEVCONF_ALL(dev_net(dev), ARP_ACCEPT)) { 892 if (IN_DEV_ARP_ACCEPT(in_dev)) {
893 /* Unsolicited ARP is not accepted by default. 893 /* Unsolicited ARP is not accepted by default.
894 It is possible, that this option should be enabled for some 894 It is possible, that this option should be enabled for some
895 devices (strip is candidate) 895 devices (strip is candidate)