[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>
This commit is contained in:
committed by
David S. Miller
parent
bbe735e424
commit
d56f90a7c9
@ -361,7 +361,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
|
||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
|
||||
if (skb->ip_summed == CHECKSUM_COMPLETE) {
|
||||
skb_postpull_rcsum(skb, skb->nh.raw,
|
||||
skb_postpull_rcsum(skb, skb_network_header(skb),
|
||||
skb->h.raw - skb->nh.raw);
|
||||
if (!csum_ipv6_magic(&skb->nh.ipv6h->saddr,
|
||||
&skb->nh.ipv6h->daddr,
|
||||
@ -488,7 +488,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
|
||||
goto out;
|
||||
|
||||
offset = rp->offset;
|
||||
total_len = inet_sk(sk)->cork.length - (skb->nh.raw - skb->data);
|
||||
total_len = inet_sk(sk)->cork.length - (skb_network_header(skb) -
|
||||
skb->data);
|
||||
if (offset >= total_len - 1) {
|
||||
err = -EINVAL;
|
||||
ip6_flush_pending_frames(sk);
|
||||
|
Reference in New Issue
Block a user