kernel: properly pad the allocated headroom in skb_cow to NET_SKB_PAD
authorFelix Fietkau <nbd@openwrt.org>
Sun, 27 May 2012 15:16:37 +0000 (15:16 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 27 May 2012 15:16:37 +0000 (15:16 +0000)
SVN-Revision: 31906

target/linux/generic/patches-3.3/654-avoid_skb_cow_realloc.patch

index dfa98198ed595fed5506e357dbad354ca7871e6b..5b2537127f63f4519b925b1f1de3e1d03fea3e1b 100644 (file)
        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)