aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2013-04-30 04:01:18 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2013-05-06 06:28:01 -0400
commite778f56e2fdf2302626f40f01b3ffa33e4fd18a4 (patch)
tree8dcea512c95276f8ced4086fd408355bfa9a23b4 /net
parentefeaa5550e4bfd335396415958fe3615530e5d5c (diff)
netfilter: nf_{log,queue}: fix compilation without CONFIG_PROC_FS
This patch fixes the following compilation error: net/netfilter/nf_log.c:373:38: error: 'struct netns_nf' has no member named 'proc_netfilter' if procfs is not set. The netns support for nf_log, nfnetlink_log and nfnetlink_queue_core requires CONFIG_PROC_FS in the removal path of their respective /proc interface since net->nf.proc_netfilter is undefined in that case. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Gao feng <gaofeng@cn.fujitsu.com>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_log.c5
-rw-r--r--net/netfilter/nfnetlink_log.c2
-rw-r--r--net/netfilter/nfnetlink_queue_core.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index 388656d5a9ec..757951d251e3 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -368,17 +368,20 @@ static int __net_init nf_log_net_init(struct net *net)
368 return 0; 368 return 0;
369 369
370out_sysctl: 370out_sysctl:
371#ifdef CONFIG_PROC_FS
371 /* For init_net: errors will trigger panic, don't unroll on error. */ 372 /* For init_net: errors will trigger panic, don't unroll on error. */
372 if (!net_eq(net, &init_net)) 373 if (!net_eq(net, &init_net))
373 remove_proc_entry("nf_log", net->nf.proc_netfilter); 374 remove_proc_entry("nf_log", net->nf.proc_netfilter);
374 375#endif
375 return ret; 376 return ret;
376} 377}
377 378
378static void __net_exit nf_log_net_exit(struct net *net) 379static void __net_exit nf_log_net_exit(struct net *net)
379{ 380{
380 netfilter_log_sysctl_exit(net); 381 netfilter_log_sysctl_exit(net);
382#ifdef CONFIG_PROC_FS
381 remove_proc_entry("nf_log", net->nf.proc_netfilter); 383 remove_proc_entry("nf_log", net->nf.proc_netfilter);
384#endif
382} 385}
383 386
384static struct pernet_operations nf_log_net_ops = { 387static struct pernet_operations nf_log_net_ops = {
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index faf1e9300d8a..d83d881002a6 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -1045,7 +1045,9 @@ static int __net_init nfnl_log_net_init(struct net *net)
1045 1045
1046static void __net_exit nfnl_log_net_exit(struct net *net) 1046static void __net_exit nfnl_log_net_exit(struct net *net)
1047{ 1047{
1048#ifdef CONFIG_PROC_FS
1048 remove_proc_entry("nfnetlink_log", net->nf.proc_netfilter); 1049 remove_proc_entry("nfnetlink_log", net->nf.proc_netfilter);
1050#endif
1049} 1051}
1050 1052
1051static struct pernet_operations nfnl_log_net_ops = { 1053static struct pernet_operations nfnl_log_net_ops = {
diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
index 2e0e835baf72..4e27fa035814 100644
--- a/net/netfilter/nfnetlink_queue_core.c
+++ b/net/netfilter/nfnetlink_queue_core.c
@@ -1285,7 +1285,9 @@ static int __net_init nfnl_queue_net_init(struct net *net)
1285 1285
1286static void __net_exit nfnl_queue_net_exit(struct net *net) 1286static void __net_exit nfnl_queue_net_exit(struct net *net)
1287{ 1287{
1288#ifdef CONFIG_PROC_FS
1288 remove_proc_entry("nfnetlink_queue", net->nf.proc_netfilter); 1289 remove_proc_entry("nfnetlink_queue", net->nf.proc_netfilter);
1290#endif
1289} 1291}
1290 1292
1291static struct pernet_operations nfnl_queue_net_ops = { 1293static struct pernet_operations nfnl_queue_net_ops = {