[SK_BUFF]: Introduce skb_network_offset()

For the quite common 'skb->nh.raw - skb->data' sequence.

Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-03-10 22:16:10 -03:00 • committed by David S. Miller
commit bbe735e424
18 changed files with 33 additions and 28 deletions

View file

@ -148,7 +148,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
if (ka9qfrag == 1) {
skb_reserve(skbn, frontlen + 2);
skbn->nh.raw = skbn->data + (skb->nh.raw - skb->data);
skbn->nh.raw = skbn->data + skb_network_offset(skb);
memcpy(skb_put(skbn, len), skb->data, len);
p = skb_push(skbn, 2);
@ -161,7 +161,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
}
} else {
skb_reserve(skbn, frontlen + 1);
skbn->nh.raw = skbn->data + (skb->nh.raw - skb->data);
skbn->nh.raw = skbn->data + skb_network_offset(skb);
memcpy(skb_put(skbn, len), skb->data, len);
p = skb_push(skbn, 1);
*p = AX25_P_TEXT;