kernel: properly pad the allocated headroom in skb_cow to NET_SKB_PAD

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31906 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Felix Fietkau 2012-05-27 15:16:37 +00:00
parent 4f1451b47e
commit 260e2d8486
1 changed files with 2 additions and 1 deletions

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)