diff options
-rw-r--r-- | drivers/net/atlx/atl1.c | 2 | ||||
-rw-r--r-- | drivers/net/macvtap.c | 3 | ||||
-rw-r--r-- | drivers/net/tun.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 7 | ||||
-rw-r--r-- | drivers/net/virtio_net.c | 2 | ||||
-rw-r--r-- | net/core/dev.c | 6 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/ipv4/udp.c | 2 | ||||
-rw-r--r-- | net/packet/af_packet.c | 3 |
9 files changed, 13 insertions, 16 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 53363108994e..def8df83359c 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -2174,7 +2174,7 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb, | |||
2174 | u8 css, cso; | 2174 | u8 css, cso; |
2175 | 2175 | ||
2176 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 2176 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |
2177 | css = (u8) (skb->csum_start - skb_headroom(skb)); | 2177 | css = skb_checksum_start_offset(skb); |
2178 | cso = css + (u8) skb->csum_offset; | 2178 | cso = css + (u8) skb->csum_offset; |
2179 | if (unlikely(css & 0x1)) { | 2179 | if (unlikely(css & 0x1)) { |
2180 | /* L1 hardware requires an even number here */ | 2180 | /* L1 hardware requires an even number here */ |
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 42567279843e..21845affea13 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -504,8 +504,7 @@ static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb, | |||
504 | 504 | ||
505 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 505 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
506 | vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; | 506 | vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; |
507 | vnet_hdr->csum_start = skb->csum_start - | 507 | vnet_hdr->csum_start = skb_checksum_start_offset(skb); |
508 | skb_headroom(skb); | ||
509 | vnet_hdr->csum_offset = skb->csum_offset; | 508 | vnet_hdr->csum_offset = skb->csum_offset; |
510 | } /* else everything is zero */ | 509 | } /* else everything is zero */ |
511 | 510 | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 55f3a3e667a9..7599c457abd1 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -757,7 +757,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun, | |||
757 | 757 | ||
758 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 758 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
759 | gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; | 759 | gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; |
760 | gso.csum_start = skb->csum_start - skb_headroom(skb); | 760 | gso.csum_start = skb_checksum_start_offset(skb); |
761 | gso.csum_offset = skb->csum_offset; | 761 | gso.csum_offset = skb->csum_offset; |
762 | } /* else everything is zero */ | 762 | } /* else everything is zero */ |
763 | 763 | ||
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 65cb1abfbe57..bc86f4b6ecc2 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -1163,9 +1163,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1163 | 1163 | ||
1164 | static u32 smsc95xx_calc_csum_preamble(struct sk_buff *skb) | 1164 | static u32 smsc95xx_calc_csum_preamble(struct sk_buff *skb) |
1165 | { | 1165 | { |
1166 | int len = skb->data - skb->head; | 1166 | u16 low_16 = (u16)skb_checksum_start_offset(skb); |
1167 | u16 high_16 = (u16)(skb->csum_offset + skb->csum_start - len); | 1167 | u16 high_16 = low_16 + skb->csum_offset; |
1168 | u16 low_16 = (u16)(skb->csum_start - len); | ||
1169 | return (high_16 << 16) | low_16; | 1168 | return (high_16 << 16) | low_16; |
1170 | } | 1169 | } |
1171 | 1170 | ||
@@ -1193,7 +1192,7 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev, | |||
1193 | if (skb->len <= 45) { | 1192 | if (skb->len <= 45) { |
1194 | /* workaround - hardware tx checksum does not work | 1193 | /* workaround - hardware tx checksum does not work |
1195 | * properly with extremely small packets */ | 1194 | * properly with extremely small packets */ |
1196 | long csstart = skb->csum_start - skb_headroom(skb); | 1195 | long csstart = skb_checksum_start_offset(skb); |
1197 | __wsum calc = csum_partial(skb->data + csstart, | 1196 | __wsum calc = csum_partial(skb->data + csstart, |
1198 | skb->len - csstart, 0); | 1197 | skb->len - csstart, 0); |
1199 | *((__sum16 *)(skb->data + csstart | 1198 | *((__sum16 *)(skb->data + csstart |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index b6d402806ae6..90a23e410d1b 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -519,7 +519,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) | |||
519 | 519 | ||
520 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 520 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
521 | hdr->hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; | 521 | hdr->hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; |
522 | hdr->hdr.csum_start = skb->csum_start - skb_headroom(skb); | 522 | hdr->hdr.csum_start = skb_checksum_start_offset(skb); |
523 | hdr->hdr.csum_offset = skb->csum_offset; | 523 | hdr->hdr.csum_offset = skb->csum_offset; |
524 | } else { | 524 | } else { |
525 | hdr->hdr.flags = 0; | 525 | hdr->hdr.flags = 0; |
diff --git a/net/core/dev.c b/net/core/dev.c index 794b20de5d44..92d414ac0e30 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1793,7 +1793,7 @@ int skb_checksum_help(struct sk_buff *skb) | |||
1793 | goto out_set_summed; | 1793 | goto out_set_summed; |
1794 | } | 1794 | } |
1795 | 1795 | ||
1796 | offset = skb->csum_start - skb_headroom(skb); | 1796 | offset = skb_checksum_start_offset(skb); |
1797 | BUG_ON(offset >= skb_headlen(skb)); | 1797 | BUG_ON(offset >= skb_headlen(skb)); |
1798 | csum = skb_checksum(skb, offset, skb->len - offset, 0); | 1798 | csum = skb_checksum(skb, offset, skb->len - offset, 0); |
1799 | 1799 | ||
@@ -2090,8 +2090,8 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | |||
2090 | * checksumming here. | 2090 | * checksumming here. |
2091 | */ | 2091 | */ |
2092 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 2092 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
2093 | skb_set_transport_header(skb, skb->csum_start - | 2093 | skb_set_transport_header(skb, |
2094 | skb_headroom(skb)); | 2094 | skb_checksum_start_offset(skb)); |
2095 | if (!dev_can_checksum(dev, skb) && | 2095 | if (!dev_can_checksum(dev, skb) && |
2096 | skb_checksum_help(skb)) | 2096 | skb_checksum_help(skb)) |
2097 | goto out_kfree_skb; | 2097 | goto out_kfree_skb; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 8814a9a52f47..19d6c21220fd 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1824,7 +1824,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to) | |||
1824 | long csstart; | 1824 | long csstart; |
1825 | 1825 | ||
1826 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 1826 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
1827 | csstart = skb->csum_start - skb_headroom(skb); | 1827 | csstart = skb_checksum_start_offset(skb); |
1828 | else | 1828 | else |
1829 | csstart = skb_headlen(skb); | 1829 | csstart = skb_headlen(skb); |
1830 | 1830 | ||
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index b37181da487c..1198adf45102 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -2226,7 +2226,7 @@ struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features) | |||
2226 | /* Do software UFO. Complete and fill in the UDP checksum as HW cannot | 2226 | /* Do software UFO. Complete and fill in the UDP checksum as HW cannot |
2227 | * do checksum of UDP packets sent as multiple IP fragments. | 2227 | * do checksum of UDP packets sent as multiple IP fragments. |
2228 | */ | 2228 | */ |
2229 | offset = skb->csum_start - skb_headroom(skb); | 2229 | offset = skb_checksum_start_offset(skb); |
2230 | csum = skb_checksum(skb, offset, skb->len - offset, 0); | 2230 | csum = skb_checksum(skb, offset, skb->len - offset, 0); |
2231 | offset += skb->csum_offset; | 2231 | offset += skb->csum_offset; |
2232 | *(__sum16 *)(skb->data + offset) = csum_fold(csum); | 2232 | *(__sum16 *)(skb->data + offset) = csum_fold(csum); |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index e79efaf06389..91cb1d71f018 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -1650,8 +1650,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1650 | 1650 | ||
1651 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1651 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1652 | vnet_hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; | 1652 | vnet_hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; |
1653 | vnet_hdr.csum_start = skb->csum_start - | 1653 | vnet_hdr.csum_start = skb_checksum_start_offset(skb); |
1654 | skb_headroom(skb); | ||
1655 | vnet_hdr.csum_offset = skb->csum_offset; | 1654 | vnet_hdr.csum_offset = skb->csum_offset; |
1656 | } /* else everything is zero */ | 1655 | } /* else everything is zero */ |
1657 | 1656 | ||