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

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
...@@ -485,7 +485,8 @@ static unsigned int packet_length(const struct sk_buff *skb) ...@@ -485,7 +485,8 @@ static unsigned int packet_length(const struct sk_buff *skb)
{ {
unsigned int length = skb->len - ETH_HLEN; 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; length -= VLAN_HLEN;
/* Don't subtract for multiple VLAN tags. Most (all?) drivers allow /* Don't subtract for multiple VLAN tags. Most (all?) drivers allow
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment