net: bridge: br_fdb_external_learn_add(): always set EXT_LEARN
authorJonas Gorski <jonas.gorski@bisdn.de>
Tue, 3 Sep 2024 08:19:57 +0000 (10:19 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 4 Sep 2024 23:36:21 +0000 (16:36 -0700)
commitbee2ef946d3184e99077be526567d791c473036f
tree7465f09b520e376ea890dd20f16484221bae9285
parent8487b4af59d4d7feda4b119dc2d92c67ca25c27e
net: bridge: br_fdb_external_learn_add(): always set EXT_LEARN

When userspace wants to take over a fdb entry by setting it as
EXTERN_LEARNED, we set both flags BR_FDB_ADDED_BY_EXT_LEARN and
BR_FDB_ADDED_BY_USER in br_fdb_external_learn_add().

If the bridge updates the entry later because its port changed, we clear
the BR_FDB_ADDED_BY_EXT_LEARN flag, but leave the BR_FDB_ADDED_BY_USER
flag set.

If userspace then wants to take over the entry again,
br_fdb_external_learn_add() sees that BR_FDB_ADDED_BY_USER and skips
setting the BR_FDB_ADDED_BY_EXT_LEARN flags, thus silently ignores the
update.

Fix this by always allowing to set BR_FDB_ADDED_BY_EXT_LEARN regardless
if this was a user fdb entry or not.

Fixes: 710ae7287737 ("net: bridge: Mark FDB entries that were added by user as such")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20240903081958.29951-1-jonas.gorski@bisdn.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_fdb.c