提交 a860352e 编写于 作者: T Tobias Waldekranz 提交者: Jakub Kicinski

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: c2693363 ("net: dsa: request drivers to perform FDB isolation")
Signed-off-by: NTobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: NVladimir Oltean <olteanv@gmail.com>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220315233033.1468071-1-tobias@waldekranz.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 4de7c8bd
...@@ -2847,6 +2847,9 @@ static int dsa_slave_fdb_event(struct net_device *dev, ...@@ -2847,6 +2847,9 @@ static int dsa_slave_fdb_event(struct net_device *dev,
if (ctx && ctx != dp) if (ctx && ctx != dp)
return 0; return 0;
if (!dp->bridge)
return 0;
if (switchdev_fdb_is_dynamically_learned(fdb_info)) { if (switchdev_fdb_is_dynamically_learned(fdb_info)) {
if (dsa_port_offloads_bridge_port(dp, orig_dev)) if (dsa_port_offloads_bridge_port(dp, orig_dev))
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册