add extra safety for the packet mangling in the mvswitch driver
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 19 Jul 2008 23:09:43 +0000 (23:09 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 19 Jul 2008 23:09:43 +0000 (23:09 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11880 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/generic-2.6/files/drivers/net/phy/mvswitch.c

index be9e6afd2d14fbff7ecc5ab30bd39c8e0247aa3b..8eae439f7603482bf97742cd9a353b9b34766a38 100644 (file)
@@ -78,7 +78,7 @@ mvswitch_mangle_tx(struct sk_buff *skb, struct net_device *dev)
        if (__vlan_hwaccel_get_tag(skb, &vid))
                goto error;
 
-       if ((skb->len <= 62) || (skb_headroom(skb) < MV_HEADER_SIZE)) {
+       if (skb_cloned(skb) || (skb->len <= 62) || (skb_headroom(skb) < MV_HEADER_SIZE)) {
                if (pskb_expand_head(skb, MV_HEADER_SIZE, 0, GFP_ATOMIC))
                        goto error_expand;
                if (skb->len < 62)