Skip to content

Commit

Permalink
net:use help function of skb_checksum_start_offset to calculate offset
Browse files Browse the repository at this point in the history
Although these are equivalent, but the skb_checksum_start_offset() is more readable.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Shan Wei authored and David S. Miller committed Apr 28, 2011
1 parent f6d8bd0 commit 96339d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/tile/tilepro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
unsigned int len = skb->len;
unsigned char *data = skb->data;

unsigned int csum_start = skb->csum_start - skb_headroom(skb);
unsigned int csum_start = skb_checksum_start_offset(skb);

lepp_frag_t frags[LEPP_MAX_FRAGS];

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
/* Do software UFO. Complete and fill in the UDP checksum as HW cannot
* do checksum of UDP packets sent as multiple IP fragments.
*/
offset = skb->csum_start - skb_headroom(skb);
offset = skb_checksum_start_offset(skb);
csum = skb_checksum(skb, offset, skb->len- offset, 0);
offset += skb->csum_offset;
*(__sum16 *)(skb->data + offset) = csum_fold(csum);
Expand Down

0 comments on commit 96339d6

Please sign in to comment.