Skip to content

Commit a29aba6

Browse files
pmachatakuba-moo
authored andcommitted
net: bridge: BROPT_FDB_LOCAL_VLAN_0: Skip local FDBs on VLAN creation
When BROPT_FDB_LOCAL_VLAN_0 is enabled, the local FDB entries for the member ports as well as the bridge itself should not be created per-VLAN, but instead only on VLAN 0. Thus when a VLAN is added for a port or the bridge itself, a local FDB entry with the corresponding address should not be added when in the VLAN-0 mode. Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: Petr Machata <[email protected]> Acked-by: Nikolay Aleksandrov <[email protected]> Link: https://patch.msgid.link/bb13ba01d58ed6d5d700e012c519d38ee6806d22.1757004393.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 40df3b8 commit a29aba6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/bridge/br_vlan.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,12 @@ static int __vlan_add(struct net_bridge_vlan *v, u16 flags,
331331

332332
/* Add the dev mac and count the vlan only if it's usable */
333333
if (br_vlan_should_use(v)) {
334-
err = br_fdb_add_local(br, p, dev->dev_addr, v->vid);
335-
if (err) {
336-
br_err(br, "failed insert local address into bridge forwarding table\n");
337-
goto out_filt;
334+
if (!br_opt_get(br, BROPT_FDB_LOCAL_VLAN_0)) {
335+
err = br_fdb_add_local(br, p, dev->dev_addr, v->vid);
336+
if (err) {
337+
br_err(br, "failed insert local address into bridge forwarding table\n");
338+
goto out_filt;
339+
}
338340
}
339341
vg->num_vlans++;
340342
}

0 commit comments

Comments
 (0)