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

Commit 72ec108d authored by Jiri Benc's avatar Jiri Benc Committed by David S. Miller
Browse files

openvswitch: fix vlan subtraction from packet length



When the packet has its vlan tag in skb->vlan_tci, the length of the VLAN
header is not counted in skb->len. It doesn't make sense to subtract it.

Fixes: 018c1dda ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
Acked-by: default avatarPravin B Shelar <pshelar@ovn.org>
Acked-by: default avatarEric Garver <e@erig.me>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 20ecf1e4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -485,7 +485,8 @@ static unsigned int packet_length(const struct sk_buff *skb)
{
	unsigned int length = skb->len - ETH_HLEN;

	if (skb_vlan_tagged(skb))
	if (!skb_vlan_tag_present(skb) &&
	    eth_type_vlan(skb->protocol))
		length -= VLAN_HLEN;

	/* Don't subtract for multiple VLAN tags. Most (all?) drivers allow