Commit 12202fa7573d32aa0915cde6e8fab4c86b63ca2c
1 parent
e817961048
netfilter: remove unneeded variable proc_net_netfilter
Now that this supports net namespace for nflog and nfqueue, we can remove the global proc_net_netfilter which has no clients anymore. Based on patch from Gao feng. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Showing 2 changed files with 4 additions and 17 deletions Side-by-side Diff
include/linux/netfilter.h
... | ... | @@ -289,11 +289,6 @@ |
289 | 289 | #endif |
290 | 290 | } |
291 | 291 | |
292 | -#ifdef CONFIG_PROC_FS | |
293 | -#include <linux/proc_fs.h> | |
294 | -extern struct proc_dir_entry *proc_net_netfilter; | |
295 | -#endif | |
296 | - | |
297 | 292 | #else /* !CONFIG_NETFILTER */ |
298 | 293 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) |
299 | 294 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) |
net/netfilter/core.c
... | ... | @@ -276,23 +276,15 @@ |
276 | 276 | EXPORT_SYMBOL(nf_nat_decode_session_hook); |
277 | 277 | #endif |
278 | 278 | |
279 | -#ifdef CONFIG_PROC_FS | |
280 | -struct proc_dir_entry *proc_net_netfilter; | |
281 | -EXPORT_SYMBOL(proc_net_netfilter); | |
282 | -#endif | |
283 | - | |
284 | 279 | static int __net_init netfilter_net_init(struct net *net) |
285 | 280 | { |
286 | 281 | #ifdef CONFIG_PROC_FS |
287 | 282 | net->nf.proc_netfilter = proc_net_mkdir(net, "netfilter", |
288 | 283 | net->proc_net); |
289 | - if (net_eq(net, &init_net)) { | |
290 | - if (!net->nf.proc_netfilter) | |
291 | - return -ENOMEM; | |
292 | - else | |
293 | - proc_net_netfilter = net->nf.proc_netfilter; | |
294 | - } else if (!net->nf.proc_netfilter) { | |
295 | - pr_err("cannot create netfilter proc entry"); | |
284 | + if (!net->nf.proc_netfilter) { | |
285 | + if (!net_eq(net, &init_net)) | |
286 | + pr_err("cannot create netfilter proc entry"); | |
287 | + | |
296 | 288 | return -ENOMEM; |
297 | 289 | } |
298 | 290 | #endif |