aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 5081287923d5..bf66b114d3c2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1092,15 +1092,12 @@ int skb_checksum_help(struct sk_buff *skb, int inward)
1092 goto out; 1092 goto out;
1093 } 1093 }
1094 1094
1095 if (offset > (int)skb->len) 1095 BUG_ON(offset > (int)skb->len);
1096 BUG();
1097 csum = skb_checksum(skb, offset, skb->len-offset, 0); 1096 csum = skb_checksum(skb, offset, skb->len-offset, 0);
1098 1097
1099 offset = skb->tail - skb->h.raw; 1098 offset = skb->tail - skb->h.raw;
1100 if (offset <= 0) 1099 BUG_ON(offset <= 0);
1101 BUG(); 1100 BUG_ON(skb->csum + 2 > offset);
1102 if (skb->csum + 2 > offset)
1103 BUG();
1104 1101
1105 *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); 1102 *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum);
1106 skb->ip_summed = CHECKSUM_NONE; 1103 skb->ip_summed = CHECKSUM_NONE;