]> git.hungrycats.org Git - linux/commitdiff
[VLAN]: Do not modify the data of shared SKBs.
authorTommy Christensen <tommy.christensen@tpack.net>
Wed, 8 Oct 2003 02:01:26 +0000 (19:01 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Wed, 8 Oct 2003 02:01:26 +0000 (19:01 -0700)
net/8021q/vlan_dev.c

index 033518e01e496a6714f4db48ec97809a87e95012..5a10d94864f2ca776345855ab7debd5ad87760e7 100644 (file)
@@ -74,7 +74,11 @@ int vlan_dev_rebuild_header(struct sk_buff *skb)
 static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
 {
        if (VLAN_DEV_INFO(skb->dev)->flags & 1) {
-               skb = skb_share_check(skb, GFP_ATOMIC);
+               if (skb_shared(skb) || skb_cloned(skb)) {
+                       struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
+                       kfree(skb);
+                       skb = nskb;
+               }
                if (skb) {
                        /* Lifted from Gleb's VLAN code... */
                        memmove(skb->data - ETH_HLEN,