]> git.ipfire.org Git - people/arne_f/kernel.git/commit
net/sched: em_meta: Fix 'meta vlan' to correctly recognize zero VID frames
authorShmulik Ladkani <shmulik.ladkani@gmail.com>
Thu, 20 Oct 2016 21:18:08 +0000 (00:18 +0300)
committerJiri Slaby <jslaby@suse.cz>
Mon, 13 Mar 2017 20:40:14 +0000 (21:40 +0100)
commit5cbbb3f08868e2e430c754c4b71d0640546d6277
tree7d64622b8472690296092d83e85f3f3b764c8ef0
parent8aee8e6c2f0e8a9531a98a227e112fd4835a1881
net/sched: em_meta: Fix 'meta vlan' to correctly recognize zero VID frames

commit d65f2fa680d6f91438461df54c83a331b3a631c9 upstream.

META_COLLECTOR int_vlan_tag() assumes that if the accel tag (vlan_tci)
is zero, then no vlan accel tag is present.

This is incorrect for zero VID vlan accel packets, making the following
match fail:
  tc filter add ... basic match 'meta(vlan mask 0xfff eq 0)' ...

Apparently 'int_vlan_tag' was implemented prior VLAN_TAG_PRESENT was
introduced in 05423b2 "vlan: allow null VLAN ID to be used"
(and at time introduced, the 'vlan_tx_tag_get' call in em_meta was not
 adapted).

Fix, testing skb_vlan_tag_present instead of testing skb_vlan_tag_get's
value.

Fixes: 05423b2413 ("vlan: allow null VLAN ID to be used")
Fixes: 1a31f2042e ("netsched: Allow meta match on vlan tag on receive")
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/sched/em_meta.c