Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
8021q: fix mac_len recomputation in vlan_untag()
Browse files Browse the repository at this point in the history
[ Upstream commit 5316cf9a5197eb80b2800e1acadde287924ca975 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Antonio Quartulli authored and gregkh committed Oct 12, 2012
1 parent 1af3bea commit 4ea3465
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/8021q/vlan_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,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;
}

Expand Down Expand Up @@ -173,6 +172,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:
Expand Down

0 comments on commit 4ea3465

Please sign in to comment.