diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-22 09:10:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:10:38 -0500 |
commit | e31e0bdc7e7fb9a4b09d2f3266c035a18fdcee9d (patch) | |
tree | 30e25f733781cf80aa9fef0d58ff3476424cb9b3 /net/ipv6/reassembly.c | |
parent | b2fd5321dd160ef309dfb6cfc78ed8de4a830659 (diff) |
[NETNS][FRAGS]: Make thresholds work in namespaces.
This is the same as with the timeout variable.
Currently, after exceeding the high threshold _all_
the fragments are evicted, but it will be fixed in
later patch.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r-- | net/ipv6/reassembly.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 91761365b181..85f3fa382230 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -601,8 +601,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
601 | } | 601 | } |
602 | 602 | ||
603 | net = skb->dev->nd_net; | 603 | net = skb->dev->nd_net; |
604 | if (atomic_read(&net->ipv6.frags.mem) > | 604 | if (atomic_read(&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh) |
605 | init_net.ipv6.sysctl.frags.high_thresh) | ||
606 | ip6_evictor(net, ip6_dst_idev(skb->dst)); | 605 | ip6_evictor(net, ip6_dst_idev(skb->dst)); |
607 | 606 | ||
608 | if ((fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr, | 607 | if ((fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr, |
@@ -634,7 +633,7 @@ static struct ctl_table ip6_frags_ctl_table[] = { | |||
634 | { | 633 | { |
635 | .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH, | 634 | .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH, |
636 | .procname = "ip6frag_high_thresh", | 635 | .procname = "ip6frag_high_thresh", |
637 | .data = &init_net.ipv6.sysctl.frags.high_thresh, | 636 | .data = &init_net.ipv6.frags.high_thresh, |
638 | .maxlen = sizeof(int), | 637 | .maxlen = sizeof(int), |
639 | .mode = 0644, | 638 | .mode = 0644, |
640 | .proc_handler = &proc_dointvec | 639 | .proc_handler = &proc_dointvec |
@@ -642,7 +641,7 @@ static struct ctl_table ip6_frags_ctl_table[] = { | |||
642 | { | 641 | { |
643 | .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH, | 642 | .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH, |
644 | .procname = "ip6frag_low_thresh", | 643 | .procname = "ip6frag_low_thresh", |
645 | .data = &init_net.ipv6.sysctl.frags.low_thresh, | 644 | .data = &init_net.ipv6.frags.low_thresh, |
646 | .maxlen = sizeof(int), | 645 | .maxlen = sizeof(int), |
647 | .mode = 0644, | 646 | .mode = 0644, |
648 | .proc_handler = &proc_dointvec | 647 | .proc_handler = &proc_dointvec |
@@ -679,8 +678,8 @@ static int ip6_frags_sysctl_register(struct net *net) | |||
679 | if (table == NULL) | 678 | if (table == NULL) |
680 | goto err_alloc; | 679 | goto err_alloc; |
681 | 680 | ||
682 | table[0].mode &= ~0222; | 681 | table[0].data = &net->ipv6.frags.high_thresh; |
683 | table[1].mode &= ~0222; | 682 | table[1].data = &net->ipv6.frags.low_thresh; |
684 | table[2].data = &net->ipv6.frags.timeout; | 683 | table[2].data = &net->ipv6.frags.timeout; |
685 | table[3].mode &= ~0222; | 684 | table[3].mode &= ~0222; |
686 | } | 685 | } |
@@ -722,8 +721,8 @@ static int ipv6_frags_init_net(struct net *net) | |||
722 | { | 721 | { |
723 | ip6_frags.ctl = &net->ipv6.sysctl.frags; | 722 | ip6_frags.ctl = &net->ipv6.sysctl.frags; |
724 | 723 | ||
725 | net->ipv6.sysctl.frags.high_thresh = 256 * 1024; | 724 | net->ipv6.frags.high_thresh = 256 * 1024; |
726 | net->ipv6.sysctl.frags.low_thresh = 192 * 1024; | 725 | net->ipv6.frags.low_thresh = 192 * 1024; |
727 | net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; | 726 | net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; |
728 | net->ipv6.sysctl.frags.secret_interval = 10 * 60 * HZ; | 727 | net->ipv6.sysctl.frags.secret_interval = 10 * 60 * HZ; |
729 | 728 | ||