Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5316cf9a authored by Antonio Quartulli's avatar Antonio Quartulli Committed by David S. Miller
Browse files

8021q: fix mac_len recomputation in vlan_untag()



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: default avatarAntonio Quartulli <ordex@autistici.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 786fdf0b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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: