Skip to content

Commit

Permalink
net: dsa: allow port_bridge_join() to override extack message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Clément Léger authored and David S. Miller committed Jun 27, 2022
1 parent ebeae54 commit 1c6e808
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c6e808

Please sign in to comment.