From: Nikolay Aleksandrov Date: Thu, 23 Mar 2017 10:27:12 +0000 (+0200) Subject: net: bridge: allow SW learn to take over HW fdb entries X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e26bf45e4cb4ffaa113dc4a95a3d78bcc51e4cb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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); }