Skip to content

Commit f2f3729

Browse files
Nikolay Aleksandrovdavem330
Nikolay Aleksandrov
authored andcommitted
net: bridge: fdb: don't flush ext_learn entries
When a user-space software manages fdb entries externally it should set the ext_learn flag which marks the fdb entry as externally managed and avoids expiring it (they're treated as static fdbs). Unfortunately on events where fdb entries are flushed (STP down, netlink fdb flush etc) these fdbs are also deleted automatically by the bridge. That in turn causes trouble for the managing user-space software (e.g. in MLAG setups we lose remote fdb entries on port flaps). These entries are completely externally managed so we should avoid automatically deleting them, the only exception are offloaded entries (i.e. BR_FDB_ADDED_BY_EXT_LEARN + BR_FDB_OFFLOADED). They are flushed as before. Fixes: eb100e0 ("net: bridge: allow to add externally learned entries from user-space") Signed-off-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a4be47a commit f2f3729

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/bridge/br_fdb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ void br_fdb_delete_by_port(struct net_bridge *br,
413413

414414
if (!do_all)
415415
if (test_bit(BR_FDB_STATIC, &f->flags) ||
416+
(test_bit(BR_FDB_ADDED_BY_EXT_LEARN, &f->flags) &&
417+
!test_bit(BR_FDB_OFFLOADED, &f->flags)) ||
416418
(vid && f->key.vlan_id != vid))
417419
continue;
418420

0 commit comments

Comments
 (0)