summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@sw.ru>2008-01-31 04:49:35 -0800
committerDavid S. Miller <davem@davemloft.net>2008-01-31 19:28:06 -0800
commit3cb609d57c20027a8b39fc60b79b930a89da82d4 (patch)
treef88a4d355b6612665a0ea89ac91a746c06e2c3cc /net/netfilter
parent715cf35ac9291f31a4fea7d022695a64cac0af80 (diff)
downloadlinux-stable-3cb609d57c20027a8b39fc60b79b930a89da82d4.tar.gz
linux-stable-3cb609d57c20027a8b39fc60b79b930a89da82d4.tar.bz2
linux-stable-3cb609d57c20027a8b39fc60b79b930a89da82d4.zip
[NETFILTER]: x_tables: create per-netns /proc/net/*_tables_*
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/x_tables.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 12ed64c0bc9a..a6792089fcf9 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -922,7 +922,7 @@ static const struct file_operations xt_target_ops = {
#endif /* CONFIG_PROC_FS */
-int xt_proto_init(int af)
+int xt_proto_init(struct net *net, int af)
{
#ifdef CONFIG_PROC_FS
char buf[XT_FUNCTION_MAXNAMELEN];
@@ -936,7 +936,7 @@ int xt_proto_init(int af)
#ifdef CONFIG_PROC_FS
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_TABLES, sizeof(buf));
- proc = proc_net_fops_create(&init_net, buf, 0440, &xt_table_ops);
+ proc = proc_net_fops_create(net, buf, 0440, &xt_table_ops);
if (!proc)
goto out;
proc->data = (void *)(unsigned long)af;
@@ -944,14 +944,14 @@ int xt_proto_init(int af)
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_MATCHES, sizeof(buf));
- proc = proc_net_fops_create(&init_net, buf, 0440, &xt_match_ops);
+ proc = proc_net_fops_create(net, buf, 0440, &xt_match_ops);
if (!proc)
goto out_remove_tables;
proc->data = (void *)(unsigned long)af;
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_TARGETS, sizeof(buf));
- proc = proc_net_fops_create(&init_net, buf, 0440, &xt_target_ops);
+ proc = proc_net_fops_create(net, buf, 0440, &xt_target_ops);
if (!proc)
goto out_remove_matches;
proc->data = (void *)(unsigned long)af;
@@ -963,34 +963,34 @@ int xt_proto_init(int af)
out_remove_matches:
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_MATCHES, sizeof(buf));
- proc_net_remove(&init_net, buf);
+ proc_net_remove(net, buf);
out_remove_tables:
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_TABLES, sizeof(buf));
- proc_net_remove(&init_net, buf);
+ proc_net_remove(net, buf);
out:
return -1;
#endif
}
EXPORT_SYMBOL_GPL(xt_proto_init);
-void xt_proto_fini(int af)
+void xt_proto_fini(struct net *net, int af)
{
#ifdef CONFIG_PROC_FS
char buf[XT_FUNCTION_MAXNAMELEN];
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_TABLES, sizeof(buf));
- proc_net_remove(&init_net, buf);
+ proc_net_remove(net, buf);
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_TARGETS, sizeof(buf));
- proc_net_remove(&init_net, buf);
+ proc_net_remove(net, buf);
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_MATCHES, sizeof(buf));
- proc_net_remove(&init_net, buf);
+ proc_net_remove(net, buf);
#endif /*CONFIG_PROC_FS*/
}
EXPORT_SYMBOL_GPL(xt_proto_fini);