diff options
author | Tobias Waldekranz <tobias@waldekranz.com> | 2022-03-16 00:30:33 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-16 19:36:56 -0700 |
commit | a860352e9dd02552e04a0503d0982cf9a4d3a0f4 (patch) | |
tree | a8d25cb127f52cdf4907bd7f65b19a2213cae0cc /net/dsa | |
parent | 4de7c8bd6a380d69848ec7991cc85eeed652daac (diff) | |
download | linux-stable-a860352e9dd02552e04a0503d0982cf9a4d3a0f4.tar.gz linux-stable-a860352e9dd02552e04a0503d0982cf9a4d3a0f4.tar.bz2 linux-stable-a860352e9dd02552e04a0503d0982cf9a4d3a0f4.zip |
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>
Diffstat (limited to 'net/dsa')
-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 f9cecda791d5..d24b6bf845c1 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2847,6 +2847,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; |