8021q: fix mac_len recomputation in vlan_untag()
authorAntonio Quartulli <ordex@autistici.org>
Tue, 2 Oct 2012 06:14:17 +0000 (06:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Oct 2012 02:45:57 +0000 (22:45 -0400)
skb_reset_mac_len() relies on the value of the skb->network_header pointer,
therefore we must wait for such pointer to be recalculated before computing
the new mac_len value.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/8021q/vlan_core.c

index b258da8..add69d0 100644 (file)
@@ -105,7 +105,6 @@ static struct sk_buff *vlan_reorder_header(struct sk_buff *skb)
                return NULL;
        memmove(skb->data - ETH_HLEN, skb->data - VLAN_ETH_HLEN, 2 * ETH_ALEN);
        skb->mac_header += VLAN_HLEN;
-       skb_reset_mac_len(skb);
        return skb;
 }
 
@@ -139,6 +138,8 @@ struct sk_buff *vlan_untag(struct sk_buff *skb)
 
        skb_reset_network_header(skb);
        skb_reset_transport_header(skb);
+       skb_reset_mac_len(skb);
+
        return skb;
 
 err_free: