diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2012-04-12 22:37:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-15 12:51:34 -0400 |
commit | 748572162a2bc3ce6f0b215e25ad601c3ec33e77 (patch) | |
tree | c404a8b215afaee100abc557ed1ca0fca834843d /net/bridge | |
parent | 95c961747284a6b83a5e2d81240e214b0fa3464d (diff) |
bridge: Add br_multicast_start_querier
This patch adds the helper br_multicast_start_querier so that
the code which starts the queriers in br_multicast_toggle can
be reused elsewhere.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_multicast.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 020e463f2225..ecabf210d0d2 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -1689,9 +1689,23 @@ unlock: | |||
1689 | return err; | 1689 | return err; |
1690 | } | 1690 | } |
1691 | 1691 | ||
1692 | int br_multicast_toggle(struct net_bridge *br, unsigned long val) | 1692 | static void br_multicast_start_querier(struct net_bridge *br) |
1693 | { | 1693 | { |
1694 | struct net_bridge_port *port; | 1694 | struct net_bridge_port *port; |
1695 | |||
1696 | br_multicast_open(br); | ||
1697 | |||
1698 | list_for_each_entry(port, &br->port_list, list) { | ||
1699 | if (port->state == BR_STATE_DISABLED || | ||
1700 | port->state == BR_STATE_BLOCKING) | ||
1701 | continue; | ||
1702 | |||
1703 | __br_multicast_enable_port(port); | ||
1704 | } | ||
1705 | } | ||
1706 | |||
1707 | int br_multicast_toggle(struct net_bridge *br, unsigned long val) | ||
1708 | { | ||
1695 | int err = 0; | 1709 | int err = 0; |
1696 | struct net_bridge_mdb_htable *mdb; | 1710 | struct net_bridge_mdb_htable *mdb; |
1697 | 1711 | ||
@@ -1721,14 +1735,7 @@ rollback: | |||
1721 | goto rollback; | 1735 | goto rollback; |
1722 | } | 1736 | } |
1723 | 1737 | ||
1724 | br_multicast_open(br); | 1738 | br_multicast_start_querier(br); |
1725 | list_for_each_entry(port, &br->port_list, list) { | ||
1726 | if (port->state == BR_STATE_DISABLED || | ||
1727 | port->state == BR_STATE_BLOCKING) | ||
1728 | continue; | ||
1729 | |||
1730 | __br_multicast_enable_port(port); | ||
1731 | } | ||
1732 | 1739 | ||
1733 | unlock: | 1740 | unlock: |
1734 | spin_unlock_bh(&br->multicast_lock); | 1741 | spin_unlock_bh(&br->multicast_lock); |