]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: vlan: check early for lack of BRENTRY flag in br_vlan_add_existing
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 15 Feb 2022 17:02:08 +0000 (19:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Feb 2022 11:21:04 +0000 (11:21 +0000)
commit139f15ef8fd318659764159734d4ff72e1916a10
treed8efc6fee23be8c2a541958d5a108ab2987ffbe1
parent40dac3af7c5856b3b9eecb820adba271caaea433
net: bridge: vlan: check early for lack of BRENTRY flag in br_vlan_add_existing

When a VLAN is added to a bridge port, a master VLAN gets created on the
bridge for context, but it doesn't have the BRENTRY flag.

Then, when the same VLAN is added to the bridge itself, that enters
through the br_vlan_add_existing() code path and gains the BRENTRY flag,
thus it becomes "existing".

It seems natural to check for this condition early, because the current
code flow is to notify switchdev of the addition of a VLAN that isn't a
brentry, just to delete it immediately afterwards.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_vlan.c