For the cases where the network header is being set to a offset from skb->data.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
skb->nh.raw = skb->data;
}
+static inline void skb_set_network_header(struct sk_buff *skb, const int offset)
+{
+ skb->nh.raw = skb->data + offset;
+}
+
static inline int skb_network_offset(const struct sk_buff *skb)
{
return skb->nh.raw - skb->data;
if (ka9qfrag == 1) {
skb_reserve(skbn, frontlen + 2);
- skbn->nh.raw = skbn->data + skb_network_offset(skb);
+ skb_set_network_header(skbn,
+ skb_network_offset(skb));
memcpy(skb_put(skbn, len), skb->data, len);
p = skb_push(skbn, 2);
}
} else {
skb_reserve(skbn, frontlen + 1);
- skbn->nh.raw = skbn->data + skb_network_offset(skb);
+ skb_set_network_header(skbn,
+ skb_network_offset(skb));
memcpy(skb_put(skbn, len), skb->data, len);
p = skb_push(skbn, 1);
*p = AX25_P_TEXT;
* Find where to start putting bytes.
*/
data = skb_put(skb, fraglen);
- skb->nh.raw = data + exthdrlen;
+ skb_set_network_header(skb, exthdrlen);
+ skb->h.raw = skb->nh.raw + fragheaderlen;
data += fragheaderlen;
- skb->h.raw = data + exthdrlen;
if (fraggap) {
skb->csum = skb_copy_and_csum_bits(
return;
skb_set_mac_header(nskb, skb_mac_header(skb) - skb->head);
- nskb->nh.raw = nskb->data + (skb_network_header(skb) - skb->head);
+ skb_set_network_header(nskb,
+ skb_network_header(skb) - skb->head);
nskb->h.raw = nskb->data + (skb->h.raw - skb->head);
skb_reserve(nskb, header);
* Find where to start putting bytes
*/
data = skb_put(skb, fraglen);
- skb->nh.raw = data + exthdrlen;
+ skb_set_network_header(skb, exthdrlen);
data += fragheaderlen;
- skb->h.raw = data + exthdrlen;
+ skb->h.raw = skb->nh.raw + fragheaderlen;
if (fraggap) {
skb->csum = skb_copy_and_csum_bits(