[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>
diff --git a/net/ipv4/xfrm4_mode_transport.c b/net/ipv4/xfrm4_mode_transport.c
index a820dde..b198087 100644
--- a/net/ipv4/xfrm4_mode_transport.c
+++ b/net/ipv4/xfrm4_mode_transport.c
@@ -34,7 +34,7 @@
skb_push(skb, x->props.header_len);
skb_reset_network_header(skb);
- memmove(skb->nh.raw, iph, ihl);
+ memmove(skb_network_header(skb), iph, ihl);
return 0;
}
@@ -51,7 +51,7 @@
int ihl = skb->data - skb->h.raw;
if (skb->h.raw != skb->nh.raw) {
- memmove(skb->h.raw, skb->nh.raw, ihl);
+ memmove(skb->h.raw, skb_network_header(skb), ihl);
skb->nh.raw = skb->h.raw;
}
skb->nh.iph->tot_len = htons(skb->len + ihl);