Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89918fc270bb77cb1a0703f0ea566a692b32e324
Commit:     89918fc270bb77cb1a0703f0ea566a692b32e324
Parent:     b0f159db7c95babf1e321334eb33d42db94f2854
Author:     Daniel Lezcano <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 10 02:49:34 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:01:16 2008 -0800

    [NETNS][IPV6]: Make the ipv6 sysctl to be a netns subsystem.
    
    The initialization of the sysctl for the ipv6 protocol is changed to a
    network namespace subsystem. That means when a new network namespace
    is created the initialization function for the sysctl will be called.
    
    That do not change the behavior of the sysctl in case of the kernel
    with the network namespace disabled.
    
    Signed-off-by: Daniel Lezcano <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv6/sysctl_net_ipv6.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index f713fbf..7329dec 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -91,10 +91,10 @@ EXPORT_SYMBOL_GPL(net_ipv6_ctl_path);
 
 static struct ctl_table_header *ipv6_sysctl_header;
 
-int ipv6_sysctl_register(void)
+static int ipv6_sysctl_net_init(struct net *net)
 {
-       ipv6_sysctl_header = register_sysctl_paths(net_ipv6_ctl_path,
-                                                  ipv6_table);
+       ipv6_sysctl_header = register_net_sysctl_table(net, net_ipv6_ctl_path,
+                                                      ipv6_table);
        if (!ipv6_sysctl_header)
                return -ENOMEM;
 
@@ -102,7 +102,22 @@ int ipv6_sysctl_register(void)
 
 }
 
+static void ipv6_sysctl_net_exit(struct net *net)
+{
+       unregister_net_sysctl_table(ipv6_sysctl_header);
+}
+
+static struct pernet_operations ipv6_sysctl_net_ops = {
+       .init = ipv6_sysctl_net_init,
+       .exit = ipv6_sysctl_net_exit,
+};
+
+int ipv6_sysctl_register(void)
+{
+       return register_pernet_subsys(&ipv6_sysctl_net_ops);
+}
+
 void ipv6_sysctl_unregister(void)
 {
-       unregister_sysctl_table(ipv6_sysctl_header);
+       unregister_pernet_subsys(&ipv6_sysctl_net_ops);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to