netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: bridge: fix error in br_multicast_add_port when CONFIG_NET_SWITCHDEV=n
@ 2021-04-21 18:44 Vladimir Oltean
  2021-04-21 18:45 ` Florian Fainelli
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Vladimir Oltean @ 2021-04-21 18:44 UTC (permalink / raw)
  To: Jakub Kicinski, David S. Miller, Christian Borntraeger, netdev
  Cc: Florian Fainelli, Andrew Lunn, Jiri Pirko, Ido Schimmel,
	Roopa Prabhu, Nikolay Aleksandrov, Vladimir Oltean

From: Vladimir Oltean <vladimir.oltean@nxp.com>

When CONFIG_NET_SWITCHDEV is disabled, the shim for switchdev_port_attr_set
inside br_mc_disabled_update returns -EOPNOTSUPP. This is not caught,
and propagated to the caller of br_multicast_add_port, preventing ports
from joining the bridge.

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Fixes: ae1ea84b33da ("net: bridge: propagate error code and extack from br_mc_disabled_update")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/bridge/br_multicast.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 4daa95c913d0..2883601d5c8b 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1625,7 +1625,7 @@ int br_multicast_add_port(struct net_bridge_port *port)
 				    br_opt_get(port->br,
 					       BROPT_MULTICAST_ENABLED),
 				    NULL);
-	if (err)
+	if (err && err != -EOPNOTSUPP)
 		return err;
 
 	port->mcast_stats = netdev_alloc_pcpu_stats(struct bridge_mcast_stats);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-21 20:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-21 18:44 [PATCH net-next] net: bridge: fix error in br_multicast_add_port when CONFIG_NET_SWITCHDEV=n Vladimir Oltean
2021-04-21 18:45 ` Florian Fainelli
2021-04-21 18:49 ` Christian Borntraeger
2021-04-21 19:18 ` Nikolay Aleksandrov
2021-04-21 20:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).