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>
This commit is contained in:
committed by
David S. Miller
parent
04fb451eff
commit
55508d601d
@@ -1793,7 +1793,7 @@ int skb_checksum_help(struct sk_buff *skb)
|
||||
goto out_set_summed;
|
||||
}
|
||||
|
||||
offset = skb->csum_start - skb_headroom(skb);
|
||||
offset = skb_checksum_start_offset(skb);
|
||||
BUG_ON(offset >= skb_headlen(skb));
|
||||
csum = skb_checksum(skb, offset, skb->len - offset, 0);
|
||||
|
||||
@@ -2090,8 +2090,8 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
|
||||
* checksumming here.
|
||||
*/
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
skb_set_transport_header(skb, skb->csum_start -
|
||||
skb_headroom(skb));
|
||||
skb_set_transport_header(skb,
|
||||
skb_checksum_start_offset(skb));
|
||||
if (!dev_can_checksum(dev, skb) &&
|
||||
skb_checksum_help(skb))
|
||||
goto out_kfree_skb;
|
||||
|
||||
@@ -1824,7 +1824,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
|
||||
long csstart;
|
||||
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL)
|
||||
csstart = skb->csum_start - skb_headroom(skb);
|
||||
csstart = skb_checksum_start_offset(skb);
|
||||
else
|
||||
csstart = skb_headlen(skb);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user