]> err.no Git - linux-2.6/blobdiff - include/net/inet_hashtables.h
Merge branch 'pnp-fix' into release-2.6.27
[linux-2.6] / include / net / inet_hashtables.h
index 26336cdcdc11533934026424d8cc33921065476a..bb619d80f2e2c21d8027a54cb0d634258105a710 100644 (file)
@@ -29,6 +29,7 @@
 #include <net/inet_sock.h>
 #include <net/sock.h>
 #include <net/tcp_states.h>
+#include <net/netns/hash.h>
 
 #include <asm/atomic.h>
 #include <asm/byteorder.h>
@@ -204,7 +205,7 @@ extern void inet_bind_bucket_destroy(struct kmem_cache *cachep,
 static inline int inet_bhashfn(struct net *net,
                const __u16 lport, const int bhash_size)
 {
-       return lport & (bhash_size - 1);
+       return (lport + net_hash_mix(net)) & (bhash_size - 1);
 }
 
 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,
 /* These can have wildcards, don't try too hard. */
 static inline int inet_lhashfn(struct net *net, const unsigned short num)
 {
-       return num & (INET_LHTABLE_SIZE - 1);
+       return (num + net_hash_mix(net)) & (INET_LHTABLE_SIZE - 1);
 }
 
 static inline int inet_sk_listen_hashfn(const struct sock *sk)