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: 018c1dda5f ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
Signed-off-by: Jiri Benc <>
Acked-by: Pravin B Shelar <>
Acked-by: Eric Garver <>
Signed-off-by: David S. Miller <>
Jiri Benc 7 years ago committed by David S. Miller
parent 20ecf1e4e3
commit 72ec108d70

@ -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) &&
length -= VLAN_HLEN;
/* Don't subtract for multiple VLAN tags. Most (all?) drivers allow