summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-05-09 16:24:30 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-05-09 16:45:49 +0200
commit464c38556e06723b4c77d36fecff140b8527bc59 (patch)
tree22ae3f9db796a9c959393079ac1c930c78b1edd2 /net/netfilter
parentbbe848ec1a77dd2f9e739a7d5dca11d2ea11c09d (diff)
downloadlinux-0-day-464c38556e06723b4c77d36fecff140b8527bc59.tar.gz
linux-0-day-464c38556e06723b4c77d36fecff140b8527bc59.tar.xz
netfilter: conntrack: make netns address part of nat bysrc hash
Will be needed soon when we place all in the same hash table. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_nat_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c
index d74e7167499d8..069912c370b51 100644
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
@@ -118,7 +118,7 @@ EXPORT_SYMBOL(nf_xfrm_me_harder);
/* We keep an extra hash for each conntrack, for fast searching. */
static inline unsigned int
-hash_by_src(const struct net *net, const struct nf_conntrack_tuple *tuple)
+hash_by_src(const struct net *n, const struct nf_conntrack_tuple *tuple)
{
unsigned int hash;
@@ -126,9 +126,9 @@ hash_by_src(const struct net *net, const struct nf_conntrack_tuple *tuple)
/* Original src, to ensure we map it consistently if poss. */
hash = jhash2((u32 *)&tuple->src, sizeof(tuple->src) / sizeof(u32),
- tuple->dst.protonum ^ nf_nat_hash_rnd);
+ tuple->dst.protonum ^ nf_nat_hash_rnd ^ net_hash_mix(n));
- return reciprocal_scale(hash, net->ct.nat_htable_size);
+ return reciprocal_scale(hash, n->ct.nat_htable_size);
}
/* Is this tuple already taken? (not by us) */