aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r--net/ipv6/reassembly.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index bf4173daecbb..5cd0bc693a5f 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -82,13 +82,6 @@ struct frag_queue
82 __u16 nhoffset; 82 __u16 nhoffset;
83}; 83};
84 84
85struct inet_frags_ctl ip6_frags_ctl __read_mostly = {
86 .high_thresh = 256 * 1024,
87 .low_thresh = 192 * 1024,
88 .timeout = IPV6_FRAG_TIMEOUT,
89 .secret_interval = 10 * 60 * HZ,
90};
91
92static struct inet_frags ip6_frags; 85static struct inet_frags ip6_frags;
93 86
94int ip6_frag_nqueues(void) 87int ip6_frag_nqueues(void)
@@ -605,7 +598,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
605 return 1; 598 return 1;
606 } 599 }
607 600
608 if (atomic_read(&ip6_frags.mem) > ip6_frags_ctl.high_thresh) 601 if (atomic_read(&ip6_frags.mem) > init_net.ipv6.sysctl.frags.high_thresh)
609 ip6_evictor(ip6_dst_idev(skb->dst)); 602 ip6_evictor(ip6_dst_idev(skb->dst));
610 603
611 if ((fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr, 604 if ((fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr,
@@ -632,6 +625,11 @@ static struct inet6_protocol frag_protocol =
632 .flags = INET6_PROTO_NOPOLICY, 625 .flags = INET6_PROTO_NOPOLICY,
633}; 626};
634 627
628void ipv6_frag_sysctl_init(struct net *net)
629{
630 ip6_frags.ctl = &net->ipv6.sysctl.frags;
631}
632
635int __init ipv6_frag_init(void) 633int __init ipv6_frag_init(void)
636{ 634{
637 int ret; 635 int ret;
@@ -639,7 +637,7 @@ int __init ipv6_frag_init(void)
639 ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT); 637 ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT);
640 if (ret) 638 if (ret)
641 goto out; 639 goto out;
642 ip6_frags.ctl = &ip6_frags_ctl; 640
643 ip6_frags.hashfn = ip6_hashfn; 641 ip6_frags.hashfn = ip6_hashfn;
644 ip6_frags.constructor = ip6_frag_init; 642 ip6_frags.constructor = ip6_frag_init;
645 ip6_frags.destructor = NULL; 643 ip6_frags.destructor = NULL;