diff options
-rw-r--r-- | net/core/skbuff.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6adf19ec95cc..a2473b1600e3 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -3026,12 +3026,12 @@ EXPORT_SYMBOL_GPL(skb_tstamp_tx); | |||
3026 | */ | 3026 | */ |
3027 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off) | 3027 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off) |
3028 | { | 3028 | { |
3029 | if (unlikely(start > skb->len - 2) || | 3029 | if (unlikely(start > skb_headlen(skb)) || |
3030 | unlikely((int)start + off > skb->len - 2)) { | 3030 | unlikely((int)start + off > skb_headlen(skb) - 2)) { |
3031 | if (net_ratelimit()) | 3031 | if (net_ratelimit()) |
3032 | printk(KERN_WARNING | 3032 | printk(KERN_WARNING |
3033 | "bad partial csum: csum=%u/%u len=%u\n", | 3033 | "bad partial csum: csum=%u/%u len=%u\n", |
3034 | start, off, skb->len); | 3034 | start, off, skb_headlen(skb)); |
3035 | return false; | 3035 | return false; |
3036 | } | 3036 | } |
3037 | skb->ip_summed = CHECKSUM_PARTIAL; | 3037 | skb->ip_summed = CHECKSUM_PARTIAL; |