diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-10 20:16:10 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:58 -0400 |
commit | bbe735e4247dba32568a305553b010081c8dea99 (patch) | |
tree | 95d96619c85785a47ccee48965b68d99cf946854 /net/ax25 | |
parent | e7dd65dafda5737a983c04d652a69ab8da78ee3f (diff) |
[SK_BUFF]: Introduce skb_network_offset()
For the quite common 'skb->nh.raw - skb->data' sequence.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ax25')
-rw-r--r-- | net/ax25/ax25_out.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c index 6e08dc8dee40..02dea851a11a 100644 --- a/net/ax25/ax25_out.c +++ b/net/ax25/ax25_out.c | |||
@@ -148,7 +148,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb) | |||
148 | 148 | ||
149 | if (ka9qfrag == 1) { | 149 | if (ka9qfrag == 1) { |
150 | skb_reserve(skbn, frontlen + 2); | 150 | skb_reserve(skbn, frontlen + 2); |
151 | skbn->nh.raw = skbn->data + (skb->nh.raw - skb->data); | 151 | skbn->nh.raw = skbn->data + skb_network_offset(skb); |
152 | memcpy(skb_put(skbn, len), skb->data, len); | 152 | memcpy(skb_put(skbn, len), skb->data, len); |
153 | p = skb_push(skbn, 2); | 153 | p = skb_push(skbn, 2); |
154 | 154 | ||
@@ -161,7 +161,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb) | |||
161 | } | 161 | } |
162 | } else { | 162 | } else { |
163 | skb_reserve(skbn, frontlen + 1); | 163 | skb_reserve(skbn, frontlen + 1); |
164 | skbn->nh.raw = skbn->data + (skb->nh.raw - skb->data); | 164 | skbn->nh.raw = skbn->data + skb_network_offset(skb); |
165 | memcpy(skb_put(skbn, len), skb->data, len); | 165 | memcpy(skb_put(skbn, len), skb->data, len); |
166 | p = skb_push(skbn, 1); | 166 | p = skb_push(skbn, 1); |
167 | *p = AX25_P_TEXT; | 167 | *p = AX25_P_TEXT; |