aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Lezcano <dlezcano@fr.ibm.com>2008-01-10 05:48:33 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:01:15 -0500
commit81c1c17804ac52036e07b0ba95cb637bdd4784d6 (patch)
tree57c32620d17fe3c1977b7f0566b8555c0b81f6b4
parent291480c09a9452a3d8852a9bfeb5ba2cbcfe662c (diff)
[NETNS][IPV6]: Make a subsystem for af_inet6.
This patch add a network namespace subsystem for the af_inet6 module. It does nothing right now, but one of its purpose is to receive the different variables for sysctl in order to initialize them. When the sysctl variable will be moved to the network namespace structure, they will be no longer initialized as global static variables, so we must find a place to initialize them. Because the sysctl can be disabled, it has no sense to store them in the sysctl_net_ipv6 file. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/af_inet6.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index a2842400a09e..72b898fe2dde 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -719,6 +719,21 @@ static void cleanup_ipv6_mibs(void)
719 snmp_mib_free((void **)udplite_stats_in6); 719 snmp_mib_free((void **)udplite_stats_in6);
720} 720}
721 721
722static int inet6_net_init(struct net *net)
723{
724 return 0;
725}
726
727static void inet6_net_exit(struct net *net)
728{
729 return;
730}
731
732static struct pernet_operations inet6_net_ops = {
733 .init = inet6_net_init,
734 .exit = inet6_net_exit,
735};
736
722static int __init inet6_init(void) 737static int __init inet6_init(void)
723{ 738{
724 struct sk_buff *dummy_skb; 739 struct sk_buff *dummy_skb;
@@ -782,6 +797,10 @@ static int __init inet6_init(void)
782 * able to communicate via both network protocols. 797 * able to communicate via both network protocols.
783 */ 798 */
784 799
800 err = register_pernet_subsys(&inet6_net_ops);
801 if (err)
802 goto register_pernet_fail;
803
785#ifdef CONFIG_SYSCTL 804#ifdef CONFIG_SYSCTL
786 err = ipv6_sysctl_register(); 805 err = ipv6_sysctl_register();
787 if (err) 806 if (err)
@@ -901,6 +920,8 @@ icmp_fail:
901 ipv6_sysctl_unregister(); 920 ipv6_sysctl_unregister();
902sysctl_fail: 921sysctl_fail:
903#endif 922#endif
923 unregister_pernet_subsys(&inet6_net_ops);
924register_pernet_fail:
904 cleanup_ipv6_mibs(); 925 cleanup_ipv6_mibs();
905out_unregister_sock: 926out_unregister_sock:
906 sock_unregister(PF_INET6); 927 sock_unregister(PF_INET6);
@@ -956,6 +977,7 @@ static void __exit inet6_exit(void)
956#ifdef CONFIG_SYSCTL 977#ifdef CONFIG_SYSCTL
957 ipv6_sysctl_unregister(); 978 ipv6_sysctl_unregister();
958#endif 979#endif
980 unregister_pernet_subsys(&inet6_net_ops);
959 cleanup_ipv6_mibs(); 981 cleanup_ipv6_mibs();
960 proto_unregister(&rawv6_prot); 982 proto_unregister(&rawv6_prot);
961 proto_unregister(&udplitev6_prot); 983 proto_unregister(&udplitev6_prot);