diff options
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r-- | net/ipv6/reassembly.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 63644075f2d6..693d20836b3f 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -213,8 +213,8 @@ static void ip6_frag_expire(unsigned long data) | |||
213 | goto out; | 213 | goto out; |
214 | 214 | ||
215 | rcu_read_lock(); | 215 | rcu_read_lock(); |
216 | IP6_INC_STATS_BH(__in6_dev_get(dev), IPSTATS_MIB_REASMTIMEOUT); | 216 | IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMTIMEOUT); |
217 | IP6_INC_STATS_BH(__in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); | 217 | IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); |
218 | rcu_read_unlock(); | 218 | rcu_read_unlock(); |
219 | 219 | ||
220 | /* Don't send error if the first segment did not arrive. */ | 220 | /* Don't send error if the first segment did not arrive. */ |
@@ -257,7 +257,7 @@ fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst, | |||
257 | return container_of(q, struct frag_queue, q); | 257 | return container_of(q, struct frag_queue, q); |
258 | 258 | ||
259 | oom: | 259 | oom: |
260 | IP6_INC_STATS_BH(idev, IPSTATS_MIB_REASMFAILS); | 260 | IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_REASMFAILS); |
261 | return NULL; | 261 | return NULL; |
262 | } | 262 | } |
263 | 263 | ||
@@ -267,6 +267,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
267 | struct sk_buff *prev, *next; | 267 | struct sk_buff *prev, *next; |
268 | struct net_device *dev; | 268 | struct net_device *dev; |
269 | int offset, end; | 269 | int offset, end; |
270 | struct net *net = dev_net(skb->dst->dev); | ||
270 | 271 | ||
271 | if (fq->q.last_in & INET_FRAG_COMPLETE) | 272 | if (fq->q.last_in & INET_FRAG_COMPLETE) |
272 | goto err; | 273 | goto err; |
@@ -276,7 +277,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
276 | ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1))); | 277 | ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1))); |
277 | 278 | ||
278 | if ((unsigned int)end > IPV6_MAXPLEN) { | 279 | if ((unsigned int)end > IPV6_MAXPLEN) { |
279 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), | 280 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb->dst), |
280 | IPSTATS_MIB_INHDRERRORS); | 281 | IPSTATS_MIB_INHDRERRORS); |
281 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, | 282 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, |
282 | ((u8 *)&fhdr->frag_off - | 283 | ((u8 *)&fhdr->frag_off - |
@@ -309,7 +310,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
309 | /* RFC2460 says always send parameter problem in | 310 | /* RFC2460 says always send parameter problem in |
310 | * this case. -DaveM | 311 | * this case. -DaveM |
311 | */ | 312 | */ |
312 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), | 313 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb->dst), |
313 | IPSTATS_MIB_INHDRERRORS); | 314 | IPSTATS_MIB_INHDRERRORS); |
314 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, | 315 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, |
315 | offsetof(struct ipv6hdr, payload_len)); | 316 | offsetof(struct ipv6hdr, payload_len)); |
@@ -433,7 +434,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
433 | return -1; | 434 | return -1; |
434 | 435 | ||
435 | err: | 436 | err: |
436 | IP6_INC_STATS(dev_net(skb->dst->dev), ip6_dst_idev(skb->dst), | 437 | IP6_INC_STATS(net, ip6_dst_idev(skb->dst), |
437 | IPSTATS_MIB_REASMFAILS); | 438 | IPSTATS_MIB_REASMFAILS); |
438 | kfree_skb(skb); | 439 | kfree_skb(skb); |
439 | return -1; | 440 | return -1; |
@@ -550,7 +551,8 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, | |||
550 | head->csum); | 551 | head->csum); |
551 | 552 | ||
552 | rcu_read_lock(); | 553 | rcu_read_lock(); |
553 | IP6_INC_STATS_BH(__in6_dev_get(dev), IPSTATS_MIB_REASMOKS); | 554 | IP6_INC_STATS_BH(dev_net(dev), |
555 | __in6_dev_get(dev), IPSTATS_MIB_REASMOKS); | ||
554 | rcu_read_unlock(); | 556 | rcu_read_unlock(); |
555 | fq->q.fragments = NULL; | 557 | fq->q.fragments = NULL; |
556 | return 1; | 558 | return 1; |
@@ -564,7 +566,8 @@ out_oom: | |||
564 | printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n"); | 566 | printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n"); |
565 | out_fail: | 567 | out_fail: |
566 | rcu_read_lock(); | 568 | rcu_read_lock(); |
567 | IP6_INC_STATS_BH(__in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); | 569 | IP6_INC_STATS_BH(dev_net(dev), |
570 | __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); | ||
568 | rcu_read_unlock(); | 571 | rcu_read_unlock(); |
569 | return -1; | 572 | return -1; |
570 | } | 573 | } |
@@ -576,7 +579,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
576 | struct ipv6hdr *hdr = ipv6_hdr(skb); | 579 | struct ipv6hdr *hdr = ipv6_hdr(skb); |
577 | struct net *net = dev_net(skb->dst->dev); | 580 | struct net *net = dev_net(skb->dst->dev); |
578 | 581 | ||
579 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS); | 582 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS); |
580 | 583 | ||
581 | /* Jumbo payload inhibits frag. header */ | 584 | /* Jumbo payload inhibits frag. header */ |
582 | if (hdr->payload_len==0) | 585 | if (hdr->payload_len==0) |
@@ -592,7 +595,8 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
592 | if (!(fhdr->frag_off & htons(0xFFF9))) { | 595 | if (!(fhdr->frag_off & htons(0xFFF9))) { |
593 | /* It is not a fragmented frame */ | 596 | /* It is not a fragmented frame */ |
594 | skb->transport_header += sizeof(struct frag_hdr); | 597 | skb->transport_header += sizeof(struct frag_hdr); |
595 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMOKS); | 598 | IP6_INC_STATS_BH(net, |
599 | ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMOKS); | ||
596 | 600 | ||
597 | IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); | 601 | IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); |
598 | return 1; | 602 | return 1; |
@@ -614,7 +618,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
614 | return ret; | 618 | return ret; |
615 | } | 619 | } |
616 | 620 | ||
617 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMFAILS); | 621 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMFAILS); |
618 | kfree_skb(skb); | 622 | kfree_skb(skb); |
619 | return -1; | 623 | return -1; |
620 | 624 | ||