]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: fix flags interpretation for extern learn fdb entries
authorNikolay Aleksandrov <nikolay@nvidia.com>
Tue, 10 Aug 2021 11:00:10 +0000 (14:00 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Aug 2021 18:29:39 +0000 (11:29 -0700)
commitd37fd10bd1be1d013870567bde5ac292e08185e7
treebaf2307c09b2c272f9c205eac595d942eac48478
parente7619fc9005184d4f7b91e751f79a76d5f2da1aa
net: bridge: fix flags interpretation for extern learn fdb entries

Ignore fdb flags when adding port extern learn entries and always set
BR_FDB_LOCAL flag when adding bridge extern learn entries. This is
closest to the behaviour we had before and avoids breaking any use cases
which were allowed.

This patch fixes iproute2 calls which assume NUD_PERMANENT and were
allowed before, example:
$ bridge fdb add 00:11:22:33:44:55 dev swp1 extern_learn

Extern learn entries are allowed to roam, but do not expire, so static
or dynamic flags make no sense for them.

Also add a comment for future reference.

Fixes: 576eeb71159b ("net: bridge: allow to add externally learned entries from user-space")
Fixes: d0ef242a926a ("net: bridge: validate the NUD_PERMANENT bit when adding an extern_learn FDB entry")
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20210810110010.43859-1-razor@blackwall.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/uapi/linux/neighbour.h
net/bridge/br.c
net/bridge/br_fdb.c
net/bridge/br_private.h