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.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index ecf340047cde..ced1a5f5b776 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -56,11 +56,6 @@
56#include <net/addrconf.h> 56#include <net/addrconf.h>
57#include <net/inet_frag.h> 57#include <net/inet_frag.h>
58 58
59int sysctl_ip6frag_high_thresh __read_mostly = 256*1024;
60int sysctl_ip6frag_low_thresh __read_mostly = 192*1024;
61
62int sysctl_ip6frag_time __read_mostly = IPV6_FRAG_TIMEOUT;
63
64struct ip6frag_skb_cb 59struct ip6frag_skb_cb
65{ 60{
66 struct inet6_skb_parm h; 61 struct inet6_skb_parm h;
@@ -87,6 +82,13 @@ struct frag_queue
87 __u16 nhoffset; 82 __u16 nhoffset;
88}; 83};
89 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
90static struct inet_frags ip6_frags; 92static struct inet_frags ip6_frags;
91 93
92int ip6_frag_nqueues(void) 94int ip6_frag_nqueues(void)
@@ -147,8 +149,6 @@ static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr,
147 return c & (INETFRAGS_HASHSZ - 1); 149 return c & (INETFRAGS_HASHSZ - 1);
148} 150}
149 151
150int sysctl_ip6frag_secret_interval __read_mostly = 10 * 60 * HZ;
151
152static void ip6_frag_secret_rebuild(unsigned long dummy) 152static void ip6_frag_secret_rebuild(unsigned long dummy)
153{ 153{
154 unsigned long now = jiffies; 154 unsigned long now = jiffies;
@@ -177,7 +177,7 @@ static void ip6_frag_secret_rebuild(unsigned long dummy)
177 } 177 }
178 write_unlock(&ip6_frags.lock); 178 write_unlock(&ip6_frags.lock);
179 179
180 mod_timer(&ip6_frags.secret_timer, now + sysctl_ip6frag_secret_interval); 180 mod_timer(&ip6_frags.secret_timer, now + ip6_frags_ctl.secret_interval);
181} 181}
182 182
183/* Memory Tracking Functions. */ 183/* Memory Tracking Functions. */
@@ -256,7 +256,7 @@ static void ip6_evictor(struct inet6_dev *idev)
256 struct list_head *tmp; 256 struct list_head *tmp;
257 int work; 257 int work;
258 258
259 work = atomic_read(&ip6_frags.mem) - sysctl_ip6frag_low_thresh; 259 work = atomic_read(&ip6_frags.mem) - ip6_frags_ctl.low_thresh;
260 if (work <= 0) 260 if (work <= 0)
261 return; 261 return;
262 262
@@ -348,7 +348,7 @@ static struct frag_queue *ip6_frag_intern(struct frag_queue *fq_in)
348#endif 348#endif
349 fq = fq_in; 349 fq = fq_in;
350 350
351 if (!mod_timer(&fq->q.timer, jiffies + sysctl_ip6frag_time)) 351 if (!mod_timer(&fq->q.timer, jiffies + ip6_frags_ctl.timeout))
352 atomic_inc(&fq->q.refcnt); 352 atomic_inc(&fq->q.refcnt);
353 353
354 atomic_inc(&fq->q.refcnt); 354 atomic_inc(&fq->q.refcnt);
@@ -754,7 +754,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp)
754 return 1; 754 return 1;
755 } 755 }
756 756
757 if (atomic_read(&ip6_frags.mem) > sysctl_ip6frag_high_thresh) 757 if (atomic_read(&ip6_frags.mem) > ip6_frags_ctl.high_thresh)
758 ip6_evictor(ip6_dst_idev(skb->dst)); 758 ip6_evictor(ip6_dst_idev(skb->dst));
759 759
760 if ((fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr, 760 if ((fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr,
@@ -788,8 +788,9 @@ void __init ipv6_frag_init(void)
788 788
789 init_timer(&ip6_frags.secret_timer); 789 init_timer(&ip6_frags.secret_timer);
790 ip6_frags.secret_timer.function = ip6_frag_secret_rebuild; 790 ip6_frags.secret_timer.function = ip6_frag_secret_rebuild;
791 ip6_frags.secret_timer.expires = jiffies + sysctl_ip6frag_secret_interval; 791 ip6_frags.secret_timer.expires = jiffies + ip6_frags_ctl.secret_interval;
792 add_timer(&ip6_frags.secret_timer); 792 add_timer(&ip6_frags.secret_timer);
793 793
794 ip6_frags.ctl = &ip6_frags_ctl;
794 inet_frags_init(&ip6_frags); 795 inet_frags_init(&ip6_frags);
795} 796}