summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_tables_api.c
diff options
context:
space:
mode:
authorPatrick McHardy2015-03-21 16:19:15 +0100
committerPablo Neira Ayuso2015-03-25 12:09:38 +0100
commit5ebb335dcbe63470c88c4f80f2d571089543b638 (patch)
tree92475f2f78434af4101ffe54c52dce51f76fb1a4 /net/netfilter/nf_tables_api.c
parenttcp: fix ipv4 mapped request socks (diff)
downloadkernel-qcow2-linux-5ebb335dcbe63470c88c4f80f2d571089543b638.tar.gz
kernel-qcow2-linux-5ebb335dcbe63470c88c4f80f2d571089543b638.tar.xz
kernel-qcow2-linux-5ebb335dcbe63470c88c4f80f2d571089543b638.zip
netfilter: nf_tables: move struct net pointer to base chain
The network namespace is only needed for base chains to get at the gencursor. Also convert to possible_net_t. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_tables_api.c')
-rw-r--r--net/netfilter/nf_tables_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 363a39a6c286..0b969b66cb77 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1354,6 +1354,7 @@ static int nf_tables_newchain(struct sock *nlsk, struct sk_buff *skb,
rcu_assign_pointer(basechain->stats, stats);
}
+ write_pnet(&basechain->pnet, net);
basechain->type = type;
chain = &basechain->chain;
@@ -1381,7 +1382,6 @@ static int nf_tables_newchain(struct sock *nlsk, struct sk_buff *skb,
INIT_LIST_HEAD(&chain->rules);
chain->handle = nf_tables_alloc_handle(table);
- chain->net = net;
chain->table = table;
nla_strlcpy(chain->name, name, NFT_CHAIN_MAXNAMELEN);