diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-01-23 15:12:25 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-01-23 15:14:31 +0100 |
commit | 5f9f946b39bff31bc9a4a8be18cef3354d3382ae (patch) | |
tree | 5af4a1a4171943b341cb00145f1d57c51229f2b2 /net/netfilter | |
parent | c296bb4d5d417d466c9bcc8afef68a3db5449a64 (diff) | |
download | linux-5f9f946b39bff31bc9a4a8be18cef3354d3382ae.tar.gz linux-5f9f946b39bff31bc9a4a8be18cef3354d3382ae.tar.bz2 linux-5f9f946b39bff31bc9a4a8be18cef3354d3382ae.zip |
netfilter: nf_conntrack: fix compilation if sysctl are disabled
In (f94161c netfilter: nf_conntrack: move initialization out of pernet
operations), some ifdefs were missing for sysctl dependent code.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_conntrack_standalone.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index 725bf04a2fb9..7936bf7f90ba 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c @@ -563,10 +563,14 @@ static int __init nf_conntrack_standalone_init(void) if (ret < 0) goto out_start; +#ifdef CONFIG_SYSCTL nf_ct_netfilter_header = register_net_sysctl(&init_net, "net", nf_ct_netfilter_table); - if (!nf_ct_netfilter_header) + if (!nf_ct_netfilter_header) { + pr_err("nf_conntrack: can't register to sysctl.\n"); goto out_sysctl; + } +#endif ret = register_pernet_subsys(&nf_conntrack_net_ops); if (ret < 0) @@ -576,9 +580,10 @@ static int __init nf_conntrack_standalone_init(void) return 0; out_pernet: +#ifdef CONFIG_SYSCTL unregister_net_sysctl_table(nf_ct_netfilter_header); out_sysctl: - pr_err("nf_conntrack: can't register to sysctl.\n"); +#endif nf_conntrack_cleanup_end(); out_start: return ret; @@ -588,7 +593,9 @@ static void __exit nf_conntrack_standalone_fini(void) { nf_conntrack_cleanup_start(); unregister_pernet_subsys(&nf_conntrack_net_ops); +#ifdef CONFIG_SYSCTL unregister_net_sysctl_table(nf_ct_netfilter_header); +#endif nf_conntrack_cleanup_end(); } |