]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dsa: qca8k: fix broken search_and_del
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 24 Jul 2023 03:25:30 +0000 (05:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:26:10 +0000 (10:26 +0200)
commitbb7b454fff661bea9af0eb1fb6c63606bb0ffc0c
tree6eccf0552e0a881bccdce22a761f4e2a9a98482e
parent3797de3d4b0f7da0b62420bcd6bb1766a288fe1e
net: dsa: qca8k: fix broken search_and_del

commit ae70dcb9d9ecaf7d9836d3e1b5bef654d7ef5680 upstream.

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: ba8f870dfa63 ("net: dsa: qca8k: add support for mdb_add/del")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/qca/qca8k-common.c