]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: fix checks for VLAN state in gate action
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 16 Jun 2020 23:58:43 +0000 (02:58 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Jun 2020 03:20:46 +0000 (20:20 -0700)
commit5b7f6308fb9aae03fbb9803d2a048cdb8a09f7f4
tree606c4c90925209bcf64ac77e88af250e5db97f18
parent048885dbaf4ba04ba5101546e30c40a024a6311e
net: dsa: sja1105: fix checks for VLAN state in gate action

This action requires the VLAN awareness state of the switch to be of the
same type as the key that's being added:

- If the switch is unaware of VLAN, then the tc filter key must only
  contain the destination MAC address.
- If the switch is VLAN-aware, the key must also contain the VLAN ID and
  PCP.

But this check doesn't work unless we verify the VLAN awareness state on
both the "if" and the "else" branches.

Fixes: acaa4c6e17c3 ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_vl.c