aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/inet_fragment.c7
-rw-r--r--net/ipv4/ip_fragment.c13
2 files changed, 19 insertions, 1 deletions
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index f1b95e128772..724d69aed031 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -83,6 +83,13 @@ void inet_frags_fini(struct inet_frags *f)
83} 83}
84EXPORT_SYMBOL(inet_frags_fini); 84EXPORT_SYMBOL(inet_frags_fini);
85 85
86void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f)
87{
88 nf->low_thresh = 0;
89 inet_frag_evictor(nf, f);
90}
91EXPORT_SYMBOL(inet_frags_exit_net);
92
86static inline void fq_unlink(struct inet_frag_queue *fq, struct inet_frags *f) 93static inline void fq_unlink(struct inet_frag_queue *fq, struct inet_frags *f)
87{ 94{
88 write_lock(&f->lock); 95 write_lock(&f->lock);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 29b4b0972e44..a2e92f9709db 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -713,9 +713,20 @@ static int ipv4_frags_init_net(struct net *net)
713 return ip4_frags_ctl_register(net); 713 return ip4_frags_ctl_register(net);
714} 714}
715 715
716static void ipv4_frags_exit_net(struct net *net)
717{
718 ip4_frags_ctl_unregister(net);
719 inet_frags_exit_net(&net->ipv4.frags, &ip4_frags);
720}
721
722static struct pernet_operations ip4_frags_ops = {
723 .init = ipv4_frags_init_net,
724 .exit = ipv4_frags_exit_net,
725};
726
716void __init ipfrag_init(void) 727void __init ipfrag_init(void)
717{ 728{
718 ipv4_frags_init_net(&init_net); 729 register_pernet_subsys(&ip4_frags_ops);
719 ip4_frags.hashfn = ip4_hashfn; 730 ip4_frags.hashfn = ip4_hashfn;
720 ip4_frags.constructor = ip4_frag_init; 731 ip4_frags.constructor = ip4_frag_init;
721 ip4_frags.destructor = ip4_frag_free; 732 ip4_frags.destructor = ip4_frag_free;