]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/inet_sock.h
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / include / net / inet_sock.h
index 9fabe5b389122502c876ef611dc3f3342867011f..643e26be058ef2e91640fa59c1ac1e42df6e8590 100644 (file)
@@ -25,6 +25,7 @@
 #include <net/sock.h>
 #include <net/request_sock.h>
 #include <net/route.h>
+#include <net/netns/hash.h>
 
 /** struct ip_options - IP Options
  *
@@ -171,13 +172,14 @@ extern int inet_sk_rebuild_header(struct sock *sk);
 extern u32 inet_ehash_secret;
 extern void build_ehash_secret(void);
 
-static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
+static inline unsigned int inet_ehashfn(struct net *net,
+                                       const __be32 laddr, const __u16 lport,
                                        const __be32 faddr, const __be16 fport)
 {
        return jhash_3words((__force __u32) laddr,
                            (__force __u32) faddr,
                            ((__u32) lport) << 16 | (__force __u32)fport,
-                           inet_ehash_secret);
+                           inet_ehash_secret + net_hash_mix(net));
 }
 
 static inline int inet_sk_ehashfn(const struct sock *sk)
@@ -187,8 +189,9 @@ static inline int inet_sk_ehashfn(const struct sock *sk)
        const __u16 lport = inet->num;
        const __be32 faddr = inet->daddr;
        const __be16 fport = inet->dport;
+       struct net *net = sock_net(sk);
 
-       return inet_ehashfn(laddr, lport, faddr, fport);
+       return inet_ehashfn(net, laddr, lport, faddr, fport);
 }