Skip to content

Commit 1c6e808

Browse files
clementlegerdavem330
authored andcommitted
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>
1 parent ebeae54 commit 1c6e808

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/dsa/slave.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,8 +2460,9 @@ static int dsa_slave_changeupper(struct net_device *dev,
24602460
if (!err)
24612461
dsa_bridge_mtu_normalization(dp);
24622462
if (err == -EOPNOTSUPP) {
2463-
NL_SET_ERR_MSG_MOD(extack,
2464-
"Offloading not supported");
2463+
if (!extack->_msg)
2464+
NL_SET_ERR_MSG_MOD(extack,
2465+
"Offloading not supported");
24652466
err = 0;
24662467
}
24672468
err = notifier_from_errno(err);

0 commit comments

Comments
 (0)