diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-22 09:02:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:10:34 -0500 |
commit | ac18e7509e7df327e30d6e073a787d922eaf211d (patch) | |
tree | 26be1582b59956c389a667d5426fdc538072795b /net/ipv6 | |
parent | 8d8354d2fb9277f165715a6e1cb92bcc89259975 (diff) |
[NETNS][FRAGS]: Make the inet_frag_queue lookup work in namespaces.
Since fragment management code is consolidated, we cannot have the
pointer from inet_frag_queue to struct net, since we must know what
king of fragment this is.
So, I introduce the netns_frags structure. This one is currently
empty, but will be eventually filled with per-namespace
attributes. Each inet_frag_queue is tagged with this one.
The conntrack_reasm is not "netns-izated", so it has one static
netns_frags instance to keep working in init namespace.
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/netfilter/nf_conntrack_reasm.c | 3 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index d631631189b6..18accd4eab06 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -78,6 +78,7 @@ static struct inet_frags_ctl nf_frags_ctl __read_mostly = { | |||
78 | }; | 78 | }; |
79 | 79 | ||
80 | static struct inet_frags nf_frags; | 80 | static struct inet_frags nf_frags; |
81 | static struct netns_frags nf_init_frags; | ||
81 | 82 | ||
82 | #ifdef CONFIG_SYSCTL | 83 | #ifdef CONFIG_SYSCTL |
83 | struct ctl_table nf_ct_ipv6_sysctl_table[] = { | 84 | struct ctl_table nf_ct_ipv6_sysctl_table[] = { |
@@ -212,7 +213,7 @@ fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst) | |||
212 | arg.dst = dst; | 213 | arg.dst = dst; |
213 | hash = ip6qhashfn(id, src, dst); | 214 | hash = ip6qhashfn(id, src, dst); |
214 | 215 | ||
215 | q = inet_frag_find(&nf_frags, &arg, hash); | 216 | q = inet_frag_find(&nf_init_frags, &nf_frags, &arg, hash); |
216 | if (q == NULL) | 217 | if (q == NULL) |
217 | goto oom; | 218 | goto oom; |
218 | 219 | ||
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 1815ff0cf628..ab2d53b81b70 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -234,7 +234,7 @@ out: | |||
234 | } | 234 | } |
235 | 235 | ||
236 | static __inline__ struct frag_queue * | 236 | static __inline__ struct frag_queue * |
237 | fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst, | 237 | fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst, |
238 | struct inet6_dev *idev) | 238 | struct inet6_dev *idev) |
239 | { | 239 | { |
240 | struct inet_frag_queue *q; | 240 | struct inet_frag_queue *q; |
@@ -246,7 +246,7 @@ fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst, | |||
246 | arg.dst = dst; | 246 | arg.dst = dst; |
247 | hash = ip6qhashfn(id, src, dst); | 247 | hash = ip6qhashfn(id, src, dst); |
248 | 248 | ||
249 | q = inet_frag_find(&ip6_frags, &arg, hash); | 249 | q = inet_frag_find(&net->ipv6.frags, &ip6_frags, &arg, hash); |
250 | if (q == NULL) | 250 | if (q == NULL) |
251 | goto oom; | 251 | goto oom; |
252 | 252 | ||
@@ -568,6 +568,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
568 | struct frag_hdr *fhdr; | 568 | struct frag_hdr *fhdr; |
569 | struct frag_queue *fq; | 569 | struct frag_queue *fq; |
570 | struct ipv6hdr *hdr = ipv6_hdr(skb); | 570 | struct ipv6hdr *hdr = ipv6_hdr(skb); |
571 | struct net *net; | ||
571 | 572 | ||
572 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS); | 573 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS); |
573 | 574 | ||
@@ -598,10 +599,11 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
598 | return 1; | 599 | return 1; |
599 | } | 600 | } |
600 | 601 | ||
602 | net = skb->dev->nd_net; | ||
601 | if (atomic_read(&ip6_frags.mem) > init_net.ipv6.sysctl.frags.high_thresh) | 603 | if (atomic_read(&ip6_frags.mem) > init_net.ipv6.sysctl.frags.high_thresh) |
602 | ip6_evictor(ip6_dst_idev(skb->dst)); | 604 | ip6_evictor(ip6_dst_idev(skb->dst)); |
603 | 605 | ||
604 | if ((fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr, | 606 | if ((fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr, |
605 | ip6_dst_idev(skb->dst))) != NULL) { | 607 | ip6_dst_idev(skb->dst))) != NULL) { |
606 | int ret; | 608 | int ret; |
607 | 609 | ||