]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bridge: Fix problems around fdb entries pointing to the bridge device
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Thu, 4 Aug 2016 02:11:19 +0000 (11:11 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2020 08:26:35 +0000 (10:26 +0200)
commitd7633eef5de379595beb18a42a33534de8c206aa
tree4859a49b76fa5961c30dbb1a1166d35fb0db6a77
parent7f9b6b0a1eadf99d7974958233da0b2bbe19d9a0
bridge: Fix problems around fdb entries pointing to the bridge device

commit 7bb90c3715a496c650b2e879225030f9dd9cfafb upstream.

Adding fdb entries pointing to the bridge device uses fdb_insert(),
which lacks various checks and does not respect added_by_user flag.

As a result, some inconsistent behavior can happen:
* Adding temporary entries succeeds but results in permanent entries.
* Same goes for "dynamic" and "use".
* Changing mac address of the bridge device causes deletion of
  user-added entries.
* Replacing existing entries looks successful from userspace but actually
  not, regardless of NLM_F_EXCL flag.

Use the same logic as other entries and fix them.

Fixes: 3741873b4f73 ("bridge: allow adding of fdb entries pointing to the bridge device")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bridge/br_fdb.c