Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69412
b: refs/heads/master
c: a030847
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 15, 2007
1 parent d703e1a commit 6afcb89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 172a863f2bfbacf4b6bfc06db219b946a058ce1a
refs/heads/master: a030847e9f0eed2a080f6114381c649a7aa43d25
21 changes: 10 additions & 11 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,22 +1362,21 @@ int skb_checksum_help(struct sk_buff *skb)
goto out_set_summed;
}

if (skb_cloned(skb)) {
offset = skb->csum_start - skb_headroom(skb);
BUG_ON(offset >= skb_headlen(skb));
csum = skb_checksum(skb, offset, skb->len - offset, 0);

offset += skb->csum_offset;
BUG_ON(offset + sizeof(__sum16) > skb_headlen(skb));

if (skb_cloned(skb) &&
!skb_clone_writable(skb, offset + sizeof(__sum16))) {
ret = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
if (ret)
goto out;
}

offset = skb->csum_start - skb_headroom(skb);
BUG_ON(offset > (int)skb->len);
csum = skb_checksum(skb, offset, skb->len-offset, 0);

offset = skb_headlen(skb) - offset;
BUG_ON(offset <= 0);
BUG_ON(skb->csum_offset + 2 > offset);

*(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) =
csum_fold(csum);
*(__sum16 *)(skb->data + offset) = csum_fold(csum);
out_set_summed:
skb->ip_summed = CHECKSUM_NONE;
out:
Expand Down

0 comments on commit 6afcb89

Please sign in to comment.