summaryrefslogtreecommitdiff
path: root/net/dsa
diff options
context:
space:
mode:
authorClément Léger <clement.leger@bootlin.com>2022-06-24 17:39:46 +0300
committerDavid S. Miller <davem@davemloft.net>2022-06-27 13:37:54 +0300
commit1c6e8088d9a74674b4017f8d2090ca9a314954b7 (patch)
tree519ba97f1b7bd0df589389175dccdd1580b834dd /net/dsa
parentebeae54d3a77e2f6b6b4e18a31bb9a0f7cbff238 (diff)
downloadlinux-1c6e8088d9a74674b4017f8d2090ca9a314954b7.tar.xz
net: dsa: allow port_bridge_join() to override extack message
Some drivers might report that they are unable to bridge ports by returning -EOPNOTSUPP, but still wants to override extack message. In order to do so, in dsa_slave_changeupper(), if port_bridge_join() returns -EOPNOTSUPP, check if extack message is set and if so, do not override it. Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 2e1ac638d135..509b98dd9954 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -2460,8 +2460,9 @@ static int dsa_slave_changeupper(struct net_device *dev,
if (!err)
dsa_bridge_mtu_normalization(dp);
if (err == -EOPNOTSUPP) {
- NL_SET_ERR_MSG_MOD(extack,
- "Offloading not supported");
+ if (!extack->_msg)
+ NL_SET_ERR_MSG_MOD(extack,
+ "Offloading not supported");
err = 0;
}
err = notifier_from_errno(err);