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>
This commit is contained in:
parent
efeaa5550e
commit
e778f56e2f
3 changed files with 8 additions and 1 deletions
|
@ -368,17 +368,20 @@ static int __net_init nf_log_net_init(struct net *net)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_sysctl:
|
out_sysctl:
|
||||||
|
#ifdef CONFIG_PROC_FS
|
||||||
/* For init_net: errors will trigger panic, don't unroll on error. */
|
/* For init_net: errors will trigger panic, don't unroll on error. */
|
||||||
if (!net_eq(net, &init_net))
|
if (!net_eq(net, &init_net))
|
||||||
remove_proc_entry("nf_log", net->nf.proc_netfilter);
|
remove_proc_entry("nf_log", net->nf.proc_netfilter);
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __net_exit nf_log_net_exit(struct net *net)
|
static void __net_exit nf_log_net_exit(struct net *net)
|
||||||
{
|
{
|
||||||
netfilter_log_sysctl_exit(net);
|
netfilter_log_sysctl_exit(net);
|
||||||
|
#ifdef CONFIG_PROC_FS
|
||||||
remove_proc_entry("nf_log", net->nf.proc_netfilter);
|
remove_proc_entry("nf_log", net->nf.proc_netfilter);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pernet_operations nf_log_net_ops = {
|
static struct pernet_operations nf_log_net_ops = {
|
||||||
|
|
|
@ -1045,7 +1045,9 @@ static int __net_init nfnl_log_net_init(struct net *net)
|
||||||
|
|
||||||
static void __net_exit nfnl_log_net_exit(struct net *net)
|
static void __net_exit nfnl_log_net_exit(struct net *net)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_PROC_FS
|
||||||
remove_proc_entry("nfnetlink_log", net->nf.proc_netfilter);
|
remove_proc_entry("nfnetlink_log", net->nf.proc_netfilter);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pernet_operations nfnl_log_net_ops = {
|
static struct pernet_operations nfnl_log_net_ops = {
|
||||||
|
|
|
@ -1285,7 +1285,9 @@ static int __net_init nfnl_queue_net_init(struct net *net)
|
||||||
|
|
||||||
static void __net_exit nfnl_queue_net_exit(struct net *net)
|
static void __net_exit nfnl_queue_net_exit(struct net *net)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_PROC_FS
|
||||||
remove_proc_entry("nfnetlink_queue", net->nf.proc_netfilter);
|
remove_proc_entry("nfnetlink_queue", net->nf.proc_netfilter);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pernet_operations nfnl_queue_net_ops = {
|
static struct pernet_operations nfnl_queue_net_ops = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue