diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-28 15:06:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-28 15:06:58 -0500 |
commit | 2c2aba6c561ac425602f4a0be61422224cb87151 (patch) | |
tree | 30b5f2c40b823ca61e2e0930d5e98a89a83222bb /include/net/neighbour.h | |
parent | 32288eb4d940b10e40c6d4178fe3a40d1437d2f8 (diff) |
ipv6: Use universal hash for NDISC.
In order to perform a proper universal hash on a vector of integers,
we have to use different universal hashes on each vector element.
Which means we need 4 different hash randoms for ipv6.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r-- | include/net/neighbour.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index e31f0a86f9b7..34c996f46181 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -139,10 +139,12 @@ struct pneigh_entry { | |||
139 | * neighbour table manipulation | 139 | * neighbour table manipulation |
140 | */ | 140 | */ |
141 | 141 | ||
142 | #define NEIGH_NUM_HASH_RND 4 | ||
143 | |||
142 | struct neigh_hash_table { | 144 | struct neigh_hash_table { |
143 | struct neighbour __rcu **hash_buckets; | 145 | struct neighbour __rcu **hash_buckets; |
144 | unsigned int hash_shift; | 146 | unsigned int hash_shift; |
145 | __u32 hash_rnd; | 147 | __u32 hash_rnd[NEIGH_NUM_HASH_RND]; |
146 | struct rcu_head rcu; | 148 | struct rcu_head rcu; |
147 | }; | 149 | }; |
148 | 150 | ||
@@ -154,7 +156,7 @@ struct neigh_table { | |||
154 | int key_len; | 156 | int key_len; |
155 | __u32 (*hash)(const void *pkey, | 157 | __u32 (*hash)(const void *pkey, |
156 | const struct net_device *dev, | 158 | const struct net_device *dev, |
157 | __u32 hash_rnd); | 159 | __u32 *hash_rnd); |
158 | int (*constructor)(struct neighbour *); | 160 | int (*constructor)(struct neighbour *); |
159 | int (*pconstructor)(struct pneigh_entry *); | 161 | int (*pconstructor)(struct pneigh_entry *); |
160 | void (*pdestructor)(struct pneigh_entry *); | 162 | void (*pdestructor)(struct pneigh_entry *); |