Skip to content

Commit 40df3b8

Browse files
pmachatakuba-moo
authored andcommitted
net: bridge: BROPT_FDB_LOCAL_VLAN_0: On bridge changeaddr, skip per-VLAN FDBs
When BROPT_FDB_LOCAL_VLAN_0 is enabled, the local FDB entries for the bridge itself should not be created per-VLAN, but instead only on VLAN 0. When the bridge address changes, the local FDB entries need to be updated, which is done in br_fdb_change_mac_address(). Bail out early when in VLAN-0 mode, so that the per-VLAN FDB entries are not created. The per-VLAN walk is only done afterwards. Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: Petr Machata <[email protected]> Acked-by: Nikolay Aleksandrov <[email protected]> Link: https://patch.msgid.link/0bd432cf91921ef7c4ed0e129de1d1cd358c716b.1757004393.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4cf5fd8 commit 40df3b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/bridge/br_fdb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,9 @@ void br_fdb_change_mac_address(struct net_bridge *br, const u8 *newaddr)
503503
struct net_bridge_vlan_group *vg;
504504
struct net_bridge_fdb_entry *f;
505505
struct net_bridge_vlan *v;
506+
bool local_vlan_0;
507+
508+
local_vlan_0 = br_opt_get(br, BROPT_FDB_LOCAL_VLAN_0);
506509

507510
spin_lock_bh(&br->hash_lock);
508511

@@ -514,7 +517,7 @@ void br_fdb_change_mac_address(struct net_bridge *br, const u8 *newaddr)
514517

515518
fdb_add_local(br, NULL, newaddr, 0);
516519
vg = br_vlan_group(br);
517-
if (!vg || !vg->num_vlans)
520+
if (!vg || !vg->num_vlans || local_vlan_0)
518521
goto out;
519522
/* Now remove and add entries for every VLAN configured on the
520523
* bridge. This function runs under RTNL so the bitmap will not

0 commit comments

Comments
 (0)