Commit c1c555ef authored by Patrick McHardy's avatar Patrick McHardy Committed by Linus Torvalds

[NET]: Fix skb_copy_expand offset calculation.

parent ad9b568a
...@@ -595,10 +595,10 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb, ...@@ -595,10 +595,10 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
head_copy_len = skb_headroom(skb); head_copy_len = skb_headroom(skb);
head_copy_off = 0; head_copy_off = 0;
if (newheadroom < head_copy_len) { if (newheadroom <= head_copy_len)
head_copy_off = head_copy_len - newheadroom;
head_copy_len = newheadroom; head_copy_len = newheadroom;
} else
head_copy_off = newheadroom - head_copy_len;
/* Copy the linear header and data. */ /* Copy the linear header and data. */
if (skb_copy_bits(skb, -head_copy_len, n->head + head_copy_off, if (skb_copy_bits(skb, -head_copy_len, n->head + head_copy_off,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment