Skip to content

Commit c7560d1

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: fix reference counting for LAG FDBs
Due to an invalid conflict resolution on my side while working on 2 different series (LAG FDBs and FDB isolation), dsa_switch_do_lag_fdb_add() does not store the database associated with a dsa_mac_addr structure. So after adding an FDB entry associated with a LAG, dsa_mac_addr_find() fails to find it while deleting it, because &a->db is zeroized memory for all stored FDB entries of lag->fdbs, and dsa_switch_do_lag_fdb_del() returns -ENOENT rather than deleting the entry. Fixes: c269336 ("net: dsa: request drivers to perform FDB isolation") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20220723012411.1125066-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 5fcbb71 commit c7560d1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/dsa/switch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ static int dsa_switch_do_lag_fdb_add(struct dsa_switch *ds, struct dsa_lag *lag,
344344

345345
ether_addr_copy(a->addr, addr);
346346
a->vid = vid;
347+
a->db = db;
347348
refcount_set(&a->refcount, 1);
348349
list_add_tail(&a->list, &lag->fdbs);
349350

0 commit comments

Comments
 (0)