All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-2.6.26 1/4][NETNS][ICMP]: Register pernet subsys to make ICMP sysctls per-net.
@ 2008-03-26  8:51 Pavel Emelyanov
  2008-03-26  8:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2008-03-26  8:51 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

This includes adding pernet_operations, empty init and exit
hooks and a bit of changes in sysctl_ipv4_init just not to
have this part in next patches.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 net/ipv4/sysctl_net_ipv4.c |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 88286f3..c2fca30 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -811,12 +811,34 @@ struct ctl_path net_ipv4_ctl_path[] = {
 };
 EXPORT_SYMBOL_GPL(net_ipv4_ctl_path);
 
+static __net_init int ipv4_sysctl_init_net(struct net *net)
+{
+	return 0;
+}
+
+static __net_exit void ipv4_sysctl_exit_net(struct net *net)
+{
+}
+
+static __net_initdata struct pernet_operations ipv4_sysctl_ops = {
+	.init = ipv4_sysctl_init_net,
+	.exit = ipv4_sysctl_exit_net,
+};
+
 static __init int sysctl_ipv4_init(void)
 {
 	struct ctl_table_header *hdr;
 
 	hdr = register_sysctl_paths(net_ipv4_ctl_path, ipv4_table);
-	return hdr == NULL ? -ENOMEM : 0;
+	if (hdr == NULL)
+		return -ENOMEM;
+
+	if (register_pernet_subsys(&ipv4_sysctl_ops)) {
+		unregister_sysctl_table(hdr);
+		return -ENOMEM;
+	}
+
+	return 0;
 }
 
 __initcall(sysctl_ipv4_init);
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-2.6.26 1/4][NETNS][ICMP]: Register pernet subsys to make ICMP sysctls per-net.
  2008-03-26  8:51 [PATCH net-2.6.26 1/4][NETNS][ICMP]: Register pernet subsys to make ICMP sysctls per-net Pavel Emelyanov
@ 2008-03-26  8:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-03-26  8:54 UTC (permalink / raw)
  To: xemul; +Cc: netdev, devel

From: Pavel Emelyanov <xemul@openvz.org>
Date: Wed, 26 Mar 2008 11:51:21 +0300

> This includes adding pernet_operations, empty init and exit
> hooks and a bit of changes in sysctl_ipv4_init just not to
> have this part in next patches.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-26  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-26  8:51 [PATCH net-2.6.26 1/4][NETNS][ICMP]: Register pernet subsys to make ICMP sysctls per-net Pavel Emelyanov
2008-03-26  8:54 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.