Skip to content

Commit

Permalink
net: bridge: Fix improper taking over HW learned FDB
Browse files Browse the repository at this point in the history
Commit 7e26bf4 ("net: bridge: allow SW learn to take over HW fdb
entries") added the ability to "take over an entry which was previously
learned via HW when it shows up from a SW port".

However, if an entry was learned via HW and then a control packet
(e.g., ARP request) was trapped to the CPU, the bridge driver will
update the entry and remove the externally learned flag, although the
entry is still present in HW. Instead, only clear the externally learned
flag in case of roaming.

Fixes: 7e26bf4 ("net: bridge: allow SW learn to take over HW fdb entries")
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: Arkadi Sharashevsky <[email protected]>
Cc: Nikolay Aleksandrov <[email protected]>
Acked-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Arkadi Sharshevsky authored and davem330 committed May 1, 2017
1 parent ba3f571 commit 58073b3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions net/bridge/br_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,16 +589,14 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
if (unlikely(source != fdb->dst)) {
fdb->dst = source;
fdb_modified = true;
/* Take over HW learned entry */
if (unlikely(fdb->added_by_external_learn))
fdb->added_by_external_learn = 0;
}
if (now != fdb->updated)
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;
fdb_modified = true;
}
if (unlikely(fdb_modified))
fdb_notify(br, fdb, RTM_NEWNEIGH);
}
Expand Down

0 comments on commit 58073b3

Please sign in to comment.