summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-11 08:37:28 (GMT)
committerDavid S. Miller <davem@davemloft.net>2011-07-11 08:37:28 (GMT)
commitf610b74b14d74a069f61583131e689550fd5bab3 (patch)
tree331ce90858ed17ed32b27ff9b283ced43566ea28 /include/net
parentcd0893369ca85fd11bc517081b2d9079d2ef2f90 (diff)
downloadlinux-f610b74b14d74a069f61583131e689550fd5bab3.tar.xz
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')
-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 91f0568..723bde5 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);