diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-06-02 01:19:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-03 05:51:04 -0400 |
commit | adf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch) | |
tree | 0f07542bb95de2ad537540868aba6cf87a86e17d /net/ipv6/reassembly.c | |
parent | 511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (diff) |
net: skb->dst accessors
Define three accessors to get/set dst attached to a skb
struct dst_entry *skb_dst(const struct sk_buff *skb)
void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
void skb_dst_drop(struct sk_buff *skb)
This one should replace occurrences of :
dst_release(skb->dst)
skb->dst = NULL;
Delete skb->dst field
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r-- | net/ipv6/reassembly.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index e9ac7a12f595..54a387d31e1a 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -267,7 +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 | struct net *net = dev_net(skb_dst(skb)->dev); |
271 | 271 | ||
272 | if (fq->q.last_in & INET_FRAG_COMPLETE) | 272 | if (fq->q.last_in & INET_FRAG_COMPLETE) |
273 | goto err; | 273 | goto err; |
@@ -277,7 +277,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
277 | ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1))); | 277 | ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1))); |
278 | 278 | ||
279 | if ((unsigned int)end > IPV6_MAXPLEN) { | 279 | if ((unsigned int)end > IPV6_MAXPLEN) { |
280 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb->dst), | 280 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), |
281 | IPSTATS_MIB_INHDRERRORS); | 281 | IPSTATS_MIB_INHDRERRORS); |
282 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, | 282 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, |
283 | ((u8 *)&fhdr->frag_off - | 283 | ((u8 *)&fhdr->frag_off - |
@@ -310,7 +310,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
310 | /* RFC2460 says always send parameter problem in | 310 | /* RFC2460 says always send parameter problem in |
311 | * this case. -DaveM | 311 | * this case. -DaveM |
312 | */ | 312 | */ |
313 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb->dst), | 313 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), |
314 | IPSTATS_MIB_INHDRERRORS); | 314 | IPSTATS_MIB_INHDRERRORS); |
315 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, | 315 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, |
316 | offsetof(struct ipv6hdr, payload_len)); | 316 | offsetof(struct ipv6hdr, payload_len)); |
@@ -434,7 +434,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
434 | return -1; | 434 | return -1; |
435 | 435 | ||
436 | err: | 436 | err: |
437 | IP6_INC_STATS(net, ip6_dst_idev(skb->dst), | 437 | IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), |
438 | IPSTATS_MIB_REASMFAILS); | 438 | IPSTATS_MIB_REASMFAILS); |
439 | kfree_skb(skb); | 439 | kfree_skb(skb); |
440 | return -1; | 440 | return -1; |
@@ -576,9 +576,9 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
576 | struct frag_hdr *fhdr; | 576 | struct frag_hdr *fhdr; |
577 | struct frag_queue *fq; | 577 | struct frag_queue *fq; |
578 | struct ipv6hdr *hdr = ipv6_hdr(skb); | 578 | struct ipv6hdr *hdr = ipv6_hdr(skb); |
579 | struct net *net = dev_net(skb->dst->dev); | 579 | struct net *net = dev_net(skb_dst(skb)->dev); |
580 | 580 | ||
581 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS); | 581 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS); |
582 | 582 | ||
583 | /* Jumbo payload inhibits frag. header */ | 583 | /* Jumbo payload inhibits frag. header */ |
584 | if (hdr->payload_len==0) | 584 | if (hdr->payload_len==0) |
@@ -595,17 +595,17 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
595 | /* It is not a fragmented frame */ | 595 | /* It is not a fragmented frame */ |
596 | skb->transport_header += sizeof(struct frag_hdr); | 596 | skb->transport_header += sizeof(struct frag_hdr); |
597 | IP6_INC_STATS_BH(net, | 597 | IP6_INC_STATS_BH(net, |
598 | ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMOKS); | 598 | ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMOKS); |
599 | 599 | ||
600 | IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); | 600 | IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); |
601 | return 1; | 601 | return 1; |
602 | } | 602 | } |
603 | 603 | ||
604 | if (atomic_read(&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh) | 604 | if (atomic_read(&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh) |
605 | ip6_evictor(net, ip6_dst_idev(skb->dst)); | 605 | ip6_evictor(net, ip6_dst_idev(skb_dst(skb))); |
606 | 606 | ||
607 | if ((fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr, | 607 | if ((fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr, |
608 | ip6_dst_idev(skb->dst))) != NULL) { | 608 | ip6_dst_idev(skb_dst(skb)))) != NULL) { |
609 | int ret; | 609 | int ret; |
610 | 610 | ||
611 | spin_lock(&fq->q.lock); | 611 | spin_lock(&fq->q.lock); |
@@ -617,12 +617,12 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
617 | return ret; | 617 | return ret; |
618 | } | 618 | } |
619 | 619 | ||
620 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMFAILS); | 620 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMFAILS); |
621 | kfree_skb(skb); | 621 | kfree_skb(skb); |
622 | return -1; | 622 | return -1; |
623 | 623 | ||
624 | fail_hdr: | 624 | fail_hdr: |
625 | IP6_INC_STATS(net, ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS); | 625 | IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_INHDRERRORS); |
626 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb_network_header_len(skb)); | 626 | icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb_network_header_len(skb)); |
627 | return -1; | 627 | return -1; |
628 | } | 628 | } |