kernel: properly pad the allocated headroom in skb_cow to NET_SKB_PAD

SVN-Revision: 31906
lede-17.01
Felix Fietkau 2012-05-27 15:16:37 +00:00
parent 0b8c1c8dfb
commit 51bc47ce7c
1 changed files with 2 additions and 1 deletions

View File

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