diff options
| author | Jiri Benc <jbenc@redhat.com> | 2016-10-10 11:02:43 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-10-13 10:03:23 -0400 |
| commit | 72ec108d701506fa6cd2f66ec5b15ea71df3c464 (patch) | |
| tree | beb6ca2c112efd4ec175f6b51aeba5986c637315 /net/openvswitch | |
| parent | 20ecf1e4e30005ad50f561a92c888b6477f99341 (diff) | |
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 <jbenc@redhat.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Eric Garver <e@erig.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch')
| -rw-r--r-- | net/openvswitch/vport.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 8f198437c724..7387418ac514 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) | |||
| 485 | { | 485 | { |
| 486 | unsigned int length = skb->len - ETH_HLEN; | 486 | unsigned int length = skb->len - ETH_HLEN; |
| 487 | 487 | ||
| 488 | if (skb_vlan_tagged(skb)) | 488 | if (!skb_vlan_tag_present(skb) && |
| 489 | eth_type_vlan(skb->protocol)) | ||
| 489 | length -= VLAN_HLEN; | 490 | length -= VLAN_HLEN; |
| 490 | 491 | ||
| 491 | /* Don't subtract for multiple VLAN tags. Most (all?) drivers allow | 492 | /* Don't subtract for multiple VLAN tags. Most (all?) drivers allow |
