Skip to content

Commit

Permalink
bridge: Add br_multicast_start_querier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Apr 15, 2012
1 parent 95c9617 commit 7485721
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1689,9 +1689,23 @@ int br_multicast_set_port_router(struct net_bridge_port *p, unsigned long val)
return err;
}

int br_multicast_toggle(struct net_bridge *br, unsigned long val)
static void br_multicast_start_querier(struct net_bridge *br)
{
struct net_bridge_port *port;

br_multicast_open(br);

list_for_each_entry(port, &br->port_list, list) {
if (port->state == BR_STATE_DISABLED ||
port->state == BR_STATE_BLOCKING)
continue;

__br_multicast_enable_port(port);
}
}

int br_multicast_toggle(struct net_bridge *br, unsigned long val)
{
int err = 0;
struct net_bridge_mdb_htable *mdb;

Expand Down Expand Up @@ -1721,14 +1735,7 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val)
goto rollback;
}

br_multicast_open(br);
list_for_each_entry(port, &br->port_list, list) {
if (port->state == BR_STATE_DISABLED ||
port->state == BR_STATE_BLOCKING)
continue;

__br_multicast_enable_port(port);
}
br_multicast_start_querier(br);

unlock:
spin_unlock_bh(&br->multicast_lock);
Expand Down

0 comments on commit 7485721

Please sign in to comment.