kernel: properly pad the allocated headroom in skb_cow to NET_SKB_PAD

SVN-Revision: 31906
master
Felix Fietkau 13 years ago
parent 0b8c1c8dfb
commit 51bc47ce7c
  1. 3
      target/linux/generic/patches-3.3/654-avoid_skb_cow_realloc.patch

@ -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)

Loading…
Cancel
Save