[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b81c09907ec9c297413678d5f1f210a2fa144943.1301711868.git.lucian.grijincu@gmail.com>
Date: Sat, 2 Apr 2011 04:53:25 +0200
From: Lucian Adrian Grijincu <lucian.grijincu@...il.com>
To: "'David S . Miller'" <davem@...emloft.net>,
Alexey Dobriyan <adobriyan@...il.com>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
Octavian Purdila <tavi@...pub.ro>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Cc: Lucian Adrian Grijincu <lucian.grijincu@...il.com>
Subject: [PATCH 11/24] sysctl: cookie: share acct_sysctl_table table between nets
Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@...il.com>
---
net/netfilter/nf_conntrack_acct.c | 24 +++---------------------
1 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/net/netfilter/nf_conntrack_acct.c b/net/netfilter/nf_conntrack_acct.c
index 5178c69..8f37d96 100644
--- a/net/netfilter/nf_conntrack_acct.c
+++ b/net/netfilter/nf_conntrack_acct.c
@@ -29,7 +29,7 @@ static struct ctl_table acct_sysctl_table[] = {
.data = &init_net.ct.sysctl_acct,
.maxlen = sizeof(unsigned int),
.mode = 0644,
- .proc_handler = proc_dointvec,
+ .proc_handler = netns_proc_dointvec,
},
{}
};
@@ -59,36 +59,18 @@ static struct nf_ct_ext_type acct_extend __read_mostly = {
#ifdef CONFIG_SYSCTL
static int nf_conntrack_acct_init_sysctl(struct net *net)
{
- struct ctl_table *table;
-
- table = kmemdup(acct_sysctl_table, sizeof(acct_sysctl_table),
- GFP_KERNEL);
- if (!table)
- goto out;
-
- table[0].data = &net->ct.sysctl_acct;
-
net->ct.acct_sysctl_header = register_net_sysctl_table(net,
- nf_net_netfilter_sysctl_path, table);
+ nf_net_netfilter_sysctl_path, acct_sysctl_table);
if (!net->ct.acct_sysctl_header) {
printk(KERN_ERR "nf_conntrack_acct: can't register to sysctl.\n");
- goto out_register;
+ return -ENOMEM;
}
return 0;
-
-out_register:
- kfree(table);
-out:
- return -ENOMEM;
}
static void nf_conntrack_acct_fini_sysctl(struct net *net)
{
- struct ctl_table *table;
-
- table = net->ct.acct_sysctl_header->ctl_table_arg;
unregister_net_sysctl_table(net->ct.acct_sysctl_header);
- kfree(table);
}
#else
static int nf_conntrack_acct_init_sysctl(struct net *net)
--
1.7.5.rc0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists