From 7e26bf45e4cb4ffaa113dc4a95a3d78bcc51e4cb Mon Sep 17 00:00:00 2001 From: Nikolay Aleksandrov Date: Thu, 23 Mar 2017 12:27:12 +0200 Subject: [PATCH] net: bridge: allow SW learn to take over HW fdb entries Allow to take over an entry which was previously learned via HW when it shows up from a SW port. This is analogous to how HW takes over SW learned entries already. Suggested-by: Roopa Prabhu Signed-off-by: Nikolay Aleksandrov Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller --- net/bridge/br_fdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 6e08b7199dd7..daebce89dba8 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -594,6 +594,9 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, fdb->updated = now; if (unlikely(added_by_user)) fdb->added_by_user = 1; + /* Take over HW learned entry */ + if (unlikely(fdb->added_by_external_learn)) + fdb->added_by_external_learn = 0; if (unlikely(fdb_modified)) fdb_notify(br, fdb, RTM_NEWNEIGH); } -- 2.30.2