Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256249
b: refs/heads/master
c: f610b74
h: refs/heads/master
i:
  256247: c240629
v: v3
  • Loading branch information
David S. Miller committed Jul 11, 2011
1 parent d4cd8f2 commit 1932c36
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd0893369ca85fd11bc517081b2d9079d2ef2f90
refs/heads/master: f610b74b14d74a069f61583131e689550fd5bab3
7 changes: 7 additions & 0 deletions trunk/include/net/arp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions trunk/net/core/neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift)
ret->hash_buckets = buckets;
ret->hash_shift = shift;
get_random_bytes(&ret->hash_rnd, sizeof(ret->hash_rnd));
ret->hash_rnd |= 1;
return ret;
}

Expand Down
3 changes: 1 addition & 2 deletions trunk/net/ipv4/arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
#include <linux/init.h>
#include <linux/net.h>
#include <linux/rcupdate.h>
#include <linux/jhash.h>
#include <linux/slab.h>
#ifdef CONFIG_SYSCTL
#include <linux/sysctl.h>
Expand Down Expand Up @@ -232,7 +231,7 @@ static u32 arp_hash(const void *pkey,
const struct net_device *dev,
__u32 hash_rnd)
{
return jhash_2words(*(u32 *)pkey, dev->ifindex, hash_rnd);
return arp_hashfn(*(u32 *)pkey, dev, hash_rnd);
}

static int arp_constructor(struct neighbour *neigh)
Expand Down

0 comments on commit 1932c36

Please sign in to comment.