]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: mt7530: fix VLAN traffic leaks
authorDENG Qingfang <dqfext@gmail.com>
Sun, 23 May 2021 14:51:54 +0000 (22:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2021 00:24:53 +0000 (17:24 -0700)
commit474a2ddaa192777522a7499784f1d60691cd831a
tree632d777d657a04f66b6b50f2a3478231e987fb58
parent835744e8b537389d6a448a47d0753734d4777fa4
net: dsa: mt7530: fix VLAN traffic leaks

PCR_MATRIX field was set to all 1's when VLAN filtering is enabled, but
was not reset when it is disabled, which may cause traffic leaks:

ip link add br0 type bridge vlan_filtering 1
ip link add br1 type bridge vlan_filtering 1
ip link set swp0 master br0
ip link set swp1 master br1
ip link set br0 type bridge vlan_filtering 0
ip link set br1 type bridge vlan_filtering 0
# traffic in br0 and br1 will start leaking to each other

As port_bridge_{add,del} have set up PCR_MATRIX properly, remove the
PCR_MATRIX write from mt7530_port_set_vlan_aware.

Fixes: 83163f7dca56 ("net: dsa: mediatek: add VLAN support for MT7530")
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mt7530.c