aboutsummaryrefslogtreecommitdiff
path: root/include/net/arp.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-11 01:37:28 -0700
committerDavid S. Miller <davem@davemloft.net>2011-07-11 01:37:28 -0700
commitf610b74b14d74a069f61583131e689550fd5bab3 (patch)
tree331ce90858ed17ed32b27ff9b283ced43566ea28 /include/net/arp.h
parentcd0893369ca85fd11bc517081b2d9079d2ef2f90 (diff)
ipv4: Use universal hash for ARP.
We need to make sure the multiplier is odd. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/arp.h')
-rw-r--r--include/net/arp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/arp.h b/include/net/arp.h
index 91f0568a04e..723bde501c6 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -8,6 +8,13 @@
extern struct neigh_table arp_tbl;
+static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd)
+{
+ u32 val = key ^ dev->ifindex;
+
+ return val * hash_rnd;
+}
+
extern void arp_init(void);
extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);