@@ -128,6 +128,9 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE)
#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
+#define IN_DEV_DROP_GRATUITOUS_ARP(in_dev) \
+ IN_DEV_ORCONF((in_dev), \
+ DROP_GRATUITOUS_ARP)
struct in_ifaddr {
struct hlist_node hash;
@@ -740,7 +740,7 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb)
* there will be an ARP proxy and gratuitous ARP frames are attacks
* and thus should not be accepted.
*/
- if (sip == tip && IN_DEV_ORCONF(in_dev, DROP_GRATUITOUS_ARP))
+ if (sip == tip && IN_DEV_DROP_GRATUITOUS_ARP(in_dev))
goto out_free_skb;
/*
Add macro IN_DEV_DROP_GRATUITOUS_ARP to facilitate getting drop_gratuitous_arp value. Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> --- include/linux/inetdevice.h | 3 +++ net/ipv4/arp.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)