Commit 3a7fda06ba48e97650fe44ea8e8a7cc385e1c100

Authored by Herbert Xu
Committed by David S. Miller
1 parent de140b0d51

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 4 additions and 5 deletions Side-by-side Diff

net/bridge/br_multicast.c
... ... @@ -1728,18 +1728,17 @@
1728 1728 int br_multicast_toggle(struct net_bridge *br, unsigned long val)
1729 1729 {
1730 1730 struct net_bridge_port *port;
1731   - int err = -ENOENT;
  1731 + int err = 0;
1732 1732  
1733 1733 spin_lock(&br->multicast_lock);
1734   - if (!netif_running(br->dev))
1735   - goto unlock;
1736   -
1737   - err = 0;
1738 1734 if (br->multicast_disabled == !val)
1739 1735 goto unlock;
1740 1736  
1741 1737 br->multicast_disabled = !val;
1742 1738 if (br->multicast_disabled)
  1739 + goto unlock;
  1740 +
  1741 + if (!netif_running(br->dev))
1743 1742 goto unlock;
1744 1743  
1745 1744 if (br->mdb) {