diff options
Diffstat (limited to 'include/net/inet_hashtables.h')
-rw-r--r-- | include/net/inet_hashtables.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 26336cdcdc11..bb619d80f2e2 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <net/inet_sock.h> | 29 | #include <net/inet_sock.h> |
30 | #include <net/sock.h> | 30 | #include <net/sock.h> |
31 | #include <net/tcp_states.h> | 31 | #include <net/tcp_states.h> |
32 | #include <net/netns/hash.h> | ||
32 | 33 | ||
33 | #include <asm/atomic.h> | 34 | #include <asm/atomic.h> |
34 | #include <asm/byteorder.h> | 35 | #include <asm/byteorder.h> |
@@ -204,7 +205,7 @@ extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, | |||
204 | static inline int inet_bhashfn(struct net *net, | 205 | static inline int inet_bhashfn(struct net *net, |
205 | const __u16 lport, const int bhash_size) | 206 | const __u16 lport, const int bhash_size) |
206 | { | 207 | { |
207 | return lport & (bhash_size - 1); | 208 | return (lport + net_hash_mix(net)) & (bhash_size - 1); |
208 | } | 209 | } |
209 | 210 | ||
210 | extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, | 211 | extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, |
@@ -213,7 +214,7 @@ extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, | |||
213 | /* These can have wildcards, don't try too hard. */ | 214 | /* These can have wildcards, don't try too hard. */ |
214 | static inline int inet_lhashfn(struct net *net, const unsigned short num) | 215 | static inline int inet_lhashfn(struct net *net, const unsigned short num) |
215 | { | 216 | { |
216 | return num & (INET_LHTABLE_SIZE - 1); | 217 | return (num + net_hash_mix(net)) & (INET_LHTABLE_SIZE - 1); |
217 | } | 218 | } |
218 | 219 | ||
219 | static inline int inet_sk_listen_hashfn(const struct sock *sk) | 220 | static inline int inet_sk_listen_hashfn(const struct sock *sk) |