diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-10 23:50:43 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:59 -0400 |
commit | d56f90a7c96da5187f0cdf07ee7434fe6aa78bbc (patch) | |
tree | 3b9073cecfbb3b6a1e25ab2b5dd2a22a43aef238 /net/ipv6/raw.c | |
parent | bbe735e4247dba32568a305553b010081c8dea99 (diff) |
[SK_BUFF]: Introduce skb_network_header()
For the places where we need a pointer to the network header, it is still legal
to touch skb->nh.raw directly if just adding to, subtracting from or setting it
to another layer header.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 5f26645195d..9b2bcde73f1 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -361,7 +361,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) | |||
361 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 361 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
362 | 362 | ||
363 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | 363 | if (skb->ip_summed == CHECKSUM_COMPLETE) { |
364 | skb_postpull_rcsum(skb, skb->nh.raw, | 364 | skb_postpull_rcsum(skb, skb_network_header(skb), |
365 | skb->h.raw - skb->nh.raw); | 365 | skb->h.raw - skb->nh.raw); |
366 | if (!csum_ipv6_magic(&skb->nh.ipv6h->saddr, | 366 | if (!csum_ipv6_magic(&skb->nh.ipv6h->saddr, |
367 | &skb->nh.ipv6h->daddr, | 367 | &skb->nh.ipv6h->daddr, |
@@ -488,7 +488,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl, | |||
488 | goto out; | 488 | goto out; |
489 | 489 | ||
490 | offset = rp->offset; | 490 | offset = rp->offset; |
491 | total_len = inet_sk(sk)->cork.length - (skb->nh.raw - skb->data); | 491 | total_len = inet_sk(sk)->cork.length - (skb_network_header(skb) - |
492 | skb->data); | ||
492 | if (offset >= total_len - 1) { | 493 | if (offset >= total_len - 1) { |
493 | err = -EINVAL; | 494 | err = -EINVAL; |
494 | ip6_flush_pending_frames(sk); | 495 | ip6_flush_pending_frames(sk); |