diff options
author | Tobias Waldekranz <tobias@waldekranz.com> | 2022-03-16 00:30:33 +0100 |
---|---|---|
committer | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-05-04 15:25:01 +0200 |
commit | b698ac2251f6ee63c2050fab5c21383126477f0f (patch) | |
tree | ae267261b67b9b93ba43dc243052e7d179180704 /net | |
parent | 6402591bdaa8d9f9160add9eafb71068881b79bd (diff) |
net: dsa: Never offload FDB entries on standalone ports
If a port joins a bridge that it can't offload, it will fallback to
standalone mode and software bridging. In this case, we never want to
offload any FDB entries to hardware either.
Previously, for host addresses, we would eventually end up in
dsa_port_bridge_host_fdb_add, which would unconditionally dereference
dp->bridge and cause a segfault.
Fixes: c26933639b54 ("net: dsa: request drivers to perform FDB isolation")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220315233033.1468071-1-tobias@waldekranz.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit a860352e9dd02552e04a0503d0982cf9a4d3a0f4)
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/dsa/slave.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 6760533b017d..66901a59589d 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2607,6 +2607,9 @@ static int dsa_slave_fdb_event(struct net_device *dev, if (ctx && ctx != dp) return 0; + if (!dp->bridge) + return 0; + if (switchdev_fdb_is_dynamically_learned(fdb_info)) { if (dsa_port_offloads_bridge_port(dp, orig_dev)) return 0; |