summaryrefslogtreecommitdiffstats
path: root/include/net/arp.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-11 10:37:28 +0200
committerDavid S. Miller <davem@davemloft.net>2011-07-11 10:37:28 +0200
commitf610b74b14d74a069f61583131e689550fd5bab3 (patch)
tree331ce90858ed17ed32b27ff9b283ced43566ea28 /include/net/arp.h
parentneigh: Store hash shift instead of mask. (diff)
downloadlinux-f610b74b14d74a069f61583131e689550fd5bab3.tar.xz
linux-f610b74b14d74a069f61583131e689550fd5bab3.zip
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 91f0568a04ef..723bde501c64 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);