Commit 7b597470 authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso

netfilter: conntrack: move sysctl pointer to net_generic infra

No need to keep this in struct net, place it in the net_generic data.
The sysctl pointer is removed from struct net in a followup patch.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 1d610d4d
...@@ -47,6 +47,9 @@ struct nf_conntrack_net { ...@@ -47,6 +47,9 @@ struct nf_conntrack_net {
unsigned int users4; unsigned int users4;
unsigned int users6; unsigned int users6;
unsigned int users_bridge; unsigned int users_bridge;
#ifdef CONFIG_SYSCTL
struct ctl_table_header *sysctl_header;
#endif
}; };
#include <linux/types.h> #include <linux/types.h>
......
...@@ -1027,6 +1027,7 @@ static void nf_conntrack_standalone_init_gre_sysctl(struct net *net, ...@@ -1027,6 +1027,7 @@ static void nf_conntrack_standalone_init_gre_sysctl(struct net *net,
static int nf_conntrack_standalone_init_sysctl(struct net *net) static int nf_conntrack_standalone_init_sysctl(struct net *net)
{ {
struct nf_conntrack_net *cnet = net_generic(net, nf_conntrack_net_id);
struct nf_udp_net *un = nf_udp_pernet(net); struct nf_udp_net *un = nf_udp_pernet(net);
struct ctl_table *table; struct ctl_table *table;
...@@ -1072,8 +1073,8 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net) ...@@ -1072,8 +1073,8 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net)
table[NF_SYSCTL_CT_BUCKETS].mode = 0444; table[NF_SYSCTL_CT_BUCKETS].mode = 0444;
} }
net->ct.sysctl_header = register_net_sysctl(net, "net/netfilter", table); cnet->sysctl_header = register_net_sysctl(net, "net/netfilter", table);
if (!net->ct.sysctl_header) if (!cnet->sysctl_header)
goto out_unregister_netfilter; goto out_unregister_netfilter;
return 0; return 0;
...@@ -1085,10 +1086,11 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net) ...@@ -1085,10 +1086,11 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net)
static void nf_conntrack_standalone_fini_sysctl(struct net *net) static void nf_conntrack_standalone_fini_sysctl(struct net *net)
{ {
struct nf_conntrack_net *cnet = net_generic(net, nf_conntrack_net_id);
struct ctl_table *table; struct ctl_table *table;
table = net->ct.sysctl_header->ctl_table_arg; table = cnet->sysctl_header->ctl_table_arg;
unregister_net_sysctl_table(net->ct.sysctl_header); unregister_net_sysctl_table(cnet->sysctl_header);
kfree(table); kfree(table);
} }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment