Skip to contentSkip to conversation

net: bridge: vlan: fix inverted default vlan notification

PATCH Applied Nikolay Aleksandrov 3 participants 3 messages Aug 14 – Aug 18

Subsystems (3)
lore
Share & tools
lore

Nikolay Aleksandrov

author maintainer
#0 lore raw

PATCH 1/1 net: bridge: vlan: fix inverted default vlan notification

A notification should be emitted only when the vlan delete was successful and not otherwise. The proper check is if br/nbp_vlan_delete returned 0.

Fixes f545923b4a6b ("net: bridge: vlan: notify on vlan add/delete/change flags")

---
Found this issue while preparing some vlan code cleanups.

 net/bridge/br_vlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/bridge/br_vlan.c +2 -2
index 31c1b2cf75d9..1e0e436629ec 100644
@@ -1136,7 +1136,7 @@ int __br_vlan_set_default_pvid(struct net_bridge *br, u16 pvid,
 		if (err)
 			goto out;
 
-		if (br_vlan_delete(br, old_pvid))
+		if (!br_vlan_delete(br, old_pvid))
 			br_vlan_notify(br, NULL, old_pvid, 0, RTM_DELVLAN);
 		br_vlan_notify(br, NULL, pvid, 0, RTM_NEWVLAN);
 		__set_bit(0, changed);
@@ -1158,7 +1158,7 @@ int __br_vlan_set_default_pvid(struct net_bridge *br, u16 pvid,
 				   &vlchange, extack);
 		if (err)
 			goto err_port;
-		if (nbp_vlan_delete(p, old_pvid))
+		if (!nbp_vlan_delete(p, old_pvid))
 			br_vlan_notify(br, p, old_pvid, 0, RTM_DELVLAN);
 		br_vlan_notify(p->br, p, pvid, 0, RTM_NEWVLAN);
 		__set_bit(p->port_no, changed);
Signature · 1 line
2.47.3
#2 lore raw
In reply to Nikolay Aleksandrov
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Fri, 14 Aug 2026 17:16:40 +0300 you wrote:

A notification should be emitted only when the vlan delete was successful and not otherwise. The proper check is if br/nbp_vlan_delete returned 0.

Fixes f545923b4a6b ("net: bridge: vlan: notify on vlan add/delete/change flags")

---
Found this issue while preparing some vlan code cleanups.

[...]

Here is the summary with links:
- [net] net: bridge: vlan: fix inverted default vlan notification

    https://git.kernel.org/netdev/net/c/21040c7f9315

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html