[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
@@ -28,7 +28,7 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
|
||||
unsigned int nhoff;
|
||||
|
||||
nhoff = IP6CB(skb)->nhoff;
|
||||
nexthdr = skb->nh.raw[nhoff];
|
||||
nexthdr = skb_network_header(skb)[nhoff];
|
||||
|
||||
seq = 0;
|
||||
if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
|
||||
@@ -58,7 +58,7 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
|
||||
if (nexthdr <= 0)
|
||||
goto drop_unlock;
|
||||
|
||||
skb->nh.raw[nhoff] = nexthdr;
|
||||
skb_network_header(skb)[nhoff] = nexthdr;
|
||||
|
||||
if (x->props.replay_window)
|
||||
xfrm_replay_advance(x, seq);
|
||||
@@ -113,7 +113,7 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
|
||||
} else {
|
||||
#ifdef CONFIG_NETFILTER
|
||||
skb->nh.ipv6h->payload_len = htons(skb->len);
|
||||
__skb_push(skb, skb->data - skb->nh.raw);
|
||||
__skb_push(skb, skb->data - skb_network_header(skb));
|
||||
|
||||
NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL,
|
||||
ip6_rcv_finish);
|
||||
|
Reference in New Issue
Block a user