Commit abd596a4 authored by Neil Horman's avatar Neil Horman Committed by David S. Miller

[IPV4] ARP: Alloc acceptance of unsolicited ARP via netdevice sysctl.

Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 59f1741e
...@@ -25,6 +25,7 @@ struct ipv4_devconf ...@@ -25,6 +25,7 @@ struct ipv4_devconf
int arp_filter; int arp_filter;
int arp_announce; int arp_announce;
int arp_ignore; int arp_ignore;
int arp_accept;
int medium_id; int medium_id;
int no_xfrm; int no_xfrm;
int no_policy; int no_policy;
......
...@@ -456,6 +456,7 @@ enum ...@@ -456,6 +456,7 @@ enum
NET_IPV4_CONF_ARP_ANNOUNCE=18, NET_IPV4_CONF_ARP_ANNOUNCE=18,
NET_IPV4_CONF_ARP_IGNORE=19, NET_IPV4_CONF_ARP_IGNORE=19,
NET_IPV4_CONF_PROMOTE_SECONDARIES=20, NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
NET_IPV4_CONF_ARP_ACCEPT=21,
__NET_IPV4_CONF_MAX __NET_IPV4_CONF_MAX
}; };
......
...@@ -879,7 +879,7 @@ static int arp_process(struct sk_buff *skb) ...@@ -879,7 +879,7 @@ static int arp_process(struct sk_buff *skb)
n = __neigh_lookup(&arp_tbl, &sip, dev, 0); n = __neigh_lookup(&arp_tbl, &sip, dev, 0);
#ifdef CONFIG_IP_ACCEPT_UNSOLICITED_ARP if (ipv4_devconf.arp_accept) {
/* Unsolicited ARP is not accepted by default. /* Unsolicited ARP is not accepted by default.
It is possible, that this option should be enabled for some It is possible, that this option should be enabled for some
devices (strip is candidate) devices (strip is candidate)
...@@ -888,7 +888,7 @@ static int arp_process(struct sk_buff *skb) ...@@ -888,7 +888,7 @@ static int arp_process(struct sk_buff *skb)
arp->ar_op == htons(ARPOP_REPLY) && arp->ar_op == htons(ARPOP_REPLY) &&
inet_addr_type(sip) == RTN_UNICAST) inet_addr_type(sip) == RTN_UNICAST)
n = __neigh_lookup(&arp_tbl, &sip, dev, -1); n = __neigh_lookup(&arp_tbl, &sip, dev, -1);
#endif }
if (n) { if (n) {
int state = NUD_REACHABLE; int state = NUD_REACHABLE;
......
...@@ -1393,6 +1393,14 @@ static struct devinet_sysctl_table { ...@@ -1393,6 +1393,14 @@ static struct devinet_sysctl_table {
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{
.ctl_name = NET_IPV4_CONF_ARP_ACCEPT,
.procname = "arp_accept",
.data = &ipv4_devconf.arp_accept,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{ {
.ctl_name = NET_IPV4_CONF_NOXFRM, .ctl_name = NET_IPV4_CONF_NOXFRM,
.procname = "disable_xfrm", .procname = "disable_xfrm",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment