Skip to content

Commit ae70dcb

Browse files
Ansueldavem330
authored andcommitted
net: dsa: qca8k: fix broken search_and_del
On deleting an MDB entry for a port, fdb_search_and_del is used. An FDB entry can't be modified so it needs to be deleted and readded again with the new portmap (and the port deleted as requested) We use the SEARCH operator to search the entry to edit by vid and mac address and then we check the aging if we actually found an entry. Currently the code suffer from a bug where the searched fdb entry is never read again with the found values (if found) resulting in the code always returning -EINVAL as aging was always 0. Fix this by correctly read the fdb entry after it was searched. Fixes: ba8f870 ("net: dsa: qca8k: add support for mdb_add/del") Signed-off-by: Christian Marangi <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 80248d4 commit ae70dcb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/dsa/qca/qca8k-common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ static int qca8k_fdb_search_and_del(struct qca8k_priv *priv, u8 port_mask,
293293
if (ret < 0)
294294
goto exit;
295295

296+
ret = qca8k_fdb_read(priv, &fdb);
297+
if (ret < 0)
298+
goto exit;
299+
296300
/* Rule doesn't exist. Why delete? */
297301
if (!fdb.aging) {
298302
ret = -EINVAL;

0 commit comments

Comments
 (0)