diff options
author | David S. Miller <davem@davemloft.net> | 2011-07-11 01:37:28 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-11 01:37:28 -0700 |
commit | f610b74b14d74a069f61583131e689550fd5bab3 (patch) | |
tree | 331ce90858ed17ed32b27ff9b283ced43566ea28 /include/net/arp.h | |
parent | cd0893369ca85fd11bc517081b2d9079d2ef2f90 (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.h | 7 |
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); |