Skip to content

Commit

Permalink
net: bridge: allow br_fdb_replay to be called for the bridge device
Browse files Browse the repository at this point in the history
When a port joins a bridge which already has local FDB entries pointing
to the bridge device itself, we would like to offload those, so allow
the "dev" argument to be equal to the bridge too. The code already does
what we need in that case.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Jun 29, 2021
1 parent 6eb38bf commit f851a72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/bridge/br_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,10 @@ int br_fdb_replay(const struct net_device *br_dev, const struct net_device *dev,
unsigned long action;
int err = 0;

if (!netif_is_bridge_master(br_dev) || !netif_is_bridge_port(dev))
if (!netif_is_bridge_master(br_dev))
return -EINVAL;

if (!netif_is_bridge_port(dev) && !netif_is_bridge_master(dev))
return -EINVAL;

br = netdev_priv(br_dev);
Expand Down

0 comments on commit f851a72

Please sign in to comment.