diff options
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r-- | net/ipv6/af_inet6.c | 22 |
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 | ||
722 | static int inet6_net_init(struct net *net) | ||
723 | { | ||
724 | return 0; | ||
725 | } | ||
726 | |||
727 | static void inet6_net_exit(struct net *net) | ||
728 | { | ||
729 | return; | ||
730 | } | ||
731 | |||
732 | static struct pernet_operations inet6_net_ops = { | ||
733 | .init = inet6_net_init, | ||
734 | .exit = inet6_net_exit, | ||
735 | }; | ||
736 | |||
722 | static int __init inet6_init(void) | 737 | static 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(); |
902 | sysctl_fail: | 921 | sysctl_fail: |
903 | #endif | 922 | #endif |
923 | unregister_pernet_subsys(&inet6_net_ops); | ||
924 | register_pernet_fail: | ||
904 | cleanup_ipv6_mibs(); | 925 | cleanup_ipv6_mibs(); |
905 | out_unregister_sock: | 926 | out_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); |