netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bridge: Allow multicast snooping to be disabled before ifup
@ 2010-07-29 10:45 Herbert Xu
  2010-07-31  6:37 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Herbert Xu @ 2010-07-29 10:45 UTC (permalink / raw)
  To: David S. Miller, netdev

Hi:

bridge: Allow multicast snooping to be disabled before ifup

Currently you cannot disable multicast snooping while a device is
down.  There is no good reason for this restriction and this patch
removes it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 27ae946..585ce6e 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1728,13 +1728,9 @@ unlock:
 int br_multicast_toggle(struct net_bridge *br, unsigned long val)
 {
 	struct net_bridge_port *port;
-	int err = -ENOENT;
+	int err = 0;
 
 	spin_lock(&br->multicast_lock);
-	if (!netif_running(br->dev))
-		goto unlock;
-
-	err = 0;
 	if (br->multicast_disabled == !val)
 		goto unlock;
 
@@ -1742,6 +1738,9 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val)
 	if (br->multicast_disabled)
 		goto unlock;
 
+	if (!netif_running(br->dev))
+		goto unlock;
+
 	if (br->mdb) {
 		if (br->mdb->old) {
 			err = -EEXIST;

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: bridge: Allow multicast snooping to be disabled before ifup
  2010-07-29 10:45 bridge: Allow multicast snooping to be disabled before ifup Herbert Xu
@ 2010-07-31  6:37 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-07-31  6:37 UTC (permalink / raw)
  To: herbert; +Cc: netdev

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 29 Jul 2010 18:45:30 +0800

> bridge: Allow multicast snooping to be disabled before ifup
> 
> Currently you cannot disable multicast snooping while a device is
> down.  There is no good reason for this restriction and this patch
> removes it.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

I'll apply this to net-next-2.6, thanks Herbert.

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

end of thread, other threads:[~2010-07-31  6:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 10:45 bridge: Allow multicast snooping to be disabled before ifup Herbert Xu
2010-07-31  6:37 ` David Miller

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).