diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2010-12-14 10:24:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-16 17:43:14 -0500 |
commit | 55508d601dab7df5cbcc7a63f4be8620eface204 (patch) | |
tree | 346f30fae9c726d2e73aba2e37ce1e4a31dcea8c /net/core | |
parent | 04fb451eff978ca059399eab83d5594b073caf6f (diff) |
net: Use skb_checksum_start_offset()
Replace skb->csum_start - skb_headroom(skb) with skb_checksum_start_offset().
Note for usb/smsc95xx: skb->data - skb->head == skb_headroom(skb).
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 6 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 |
2 files changed, 4 insertions, 4 deletions
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 | ||