1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-01-27 16:41:06 +02:00

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
This commit is contained in:
nbd 2012-05-27 15:16:37 +00:00
parent fe77f5d922
commit 95d801c59d

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)