kernel: properly pad the allocated headroom in skb_cow to NET_SKB_PAD

SVN-Revision: 31906
This commit is contained in:
Felix Fietkau 2012-05-27 15:16:37 +00:00
parent 0b8c1c8dfb
commit 51bc47ce7c

View file

@ -10,10 +10,11 @@
if (headroom < NET_SKB_PAD)
- headroom = NET_SKB_PAD;
- if (headroom > skb_headroom(skb))
- delta = headroom - skb_headroom(skb);
+ alloc_headroom = NET_SKB_PAD;
+ if (headroom > skb_headroom(skb) ||
+ (cloned && alloc_headroom > skb_headroom(skb))) {
delta = headroom - skb_headroom(skb);
+ delta = alloc_headroom - skb_headroom(skb);
+ }
if (delta || cloned)