From: Jiri Benc Date: Mon, 10 Oct 2016 15:02:43 +0000 (+0200) Subject: openvswitch: fix vlan subtraction from packet length X-Git-Tag: v4.9-rc1~28^2~19^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72ec108d701506fa6cd2f66ec5b15ea71df3c464;p=platform%2Fkernel%2Flinux-exynos.git 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: 018c1dda5ff1 ("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 --- diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 8f19843..7387418 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c @@ -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