diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-22 09:12:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:10:40 -0500 |
commit | 81566e8322c3f6c6f9a2277fe0e440fee8d917bd (patch) | |
tree | 2c7456cf77548436e97ae8fef5c1f91127e8fd92 /net/ipv6 | |
parent | 3140c25c82106645a6b1fc469dab7006a1d09fd0 (diff) |
[NETNS][FRAGS]: Make the pernet subsystem for fragments.
On namespace start we mainly prepare the ctl variables.
When the namespace is stopped we have to kill all the fragments that
point to this namespace. The inet_frags_exit_net() handles it.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/reassembly.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 0c4bc46dee0c..f936d045a39d 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -728,6 +728,17 @@ static int ipv6_frags_init_net(struct net *net) | |||
728 | return ip6_frags_sysctl_register(net); | 728 | return ip6_frags_sysctl_register(net); |
729 | } | 729 | } |
730 | 730 | ||
731 | static void ipv6_frags_exit_net(struct net *net) | ||
732 | { | ||
733 | ip6_frags_sysctl_unregister(net); | ||
734 | inet_frags_exit_net(&net->ipv6.frags, &ip6_frags); | ||
735 | } | ||
736 | |||
737 | static struct pernet_operations ip6_frags_ops = { | ||
738 | .init = ipv6_frags_init_net, | ||
739 | .exit = ipv6_frags_exit_net, | ||
740 | }; | ||
741 | |||
731 | int __init ipv6_frag_init(void) | 742 | int __init ipv6_frag_init(void) |
732 | { | 743 | { |
733 | int ret; | 744 | int ret; |
@@ -736,7 +747,7 @@ int __init ipv6_frag_init(void) | |||
736 | if (ret) | 747 | if (ret) |
737 | goto out; | 748 | goto out; |
738 | 749 | ||
739 | ipv6_frags_init_net(&init_net); | 750 | register_pernet_subsys(&ip6_frags_ops); |
740 | 751 | ||
741 | ip6_frags.hashfn = ip6_hashfn; | 752 | ip6_frags.hashfn = ip6_hashfn; |
742 | ip6_frags.constructor = ip6_frag_init; | 753 | ip6_frags.constructor = ip6_frag_init; |
@@ -754,5 +765,6 @@ out: | |||
754 | void ipv6_frag_exit(void) | 765 | void ipv6_frag_exit(void) |
755 | { | 766 | { |
756 | inet_frags_fini(&ip6_frags); | 767 | inet_frags_fini(&ip6_frags); |
768 | unregister_pernet_subsys(&ip6_frags_ops); | ||
757 | inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT); | 769 | inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT); |
758 | } | 770 | } |