[SK_BUFF]: Introduce skb_transport_header(skb)
[deliverable/linux.git] / net / core / dev.c
index 3af0bdc864918834875dd0d1ab499eb9405f9c5d..30fcc7f9d4edde76a685fc9d0f4ef5e1628a9ca0 100644 (file)
@@ -1156,7 +1156,7 @@ EXPORT_SYMBOL(netif_device_attach);
 int skb_checksum_help(struct sk_buff *skb)
 {
        __wsum csum;
-       int ret = 0, offset = skb->h.raw - skb->data;
+       int ret = 0, offset = skb_transport_offset(skb);
 
        if (skb->ip_summed == CHECKSUM_COMPLETE)
                goto out_set_summed;
@@ -1175,12 +1175,12 @@ int skb_checksum_help(struct sk_buff *skb)
        BUG_ON(offset > (int)skb->len);
        csum = skb_checksum(skb, offset, skb->len-offset, 0);
 
-       offset = skb->tail - skb->h.raw;
+       offset = skb->tail - skb_transport_header(skb);
        BUG_ON(offset <= 0);
        BUG_ON(skb->csum_offset + 2 > offset);
 
-       *(__sum16*)(skb->h.raw + skb->csum_offset) = csum_fold(csum);
-
+       *(__sum16 *)(skb_transport_header(skb) +
+                    skb->csum_offset) = csum_fold(csum);
 out_set_summed:
        skb->ip_summed = CHECKSUM_NONE;
 out:
@@ -1773,7 +1773,7 @@ int netif_receive_skb(struct sk_buff *skb)
        __get_cpu_var(netdev_rx_stat).total++;
 
        skb_reset_network_header(skb);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        skb->mac_len = skb->nh.raw - skb->mac.raw;
 
        pt_prev = NULL;
This page took 0.027112 seconds and 5 git commands to generate.