Patchwork [net-next,v3,3/3] bridge: send query as soon as leave is received

login
register
mail settings
Submitter Amerigo Wang
Date April 30, 2013, 7:10 a.m.
Message ID <1367305819-14013-3-git-send-email-amwang@redhat.com>
Download mbox | patch
Permalink /patch/240574/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Amerigo Wang - April 30, 2013, 7:10 a.m.
From: Cong Wang <amwang@redhat.com>

Send a non-general query when leave is received, if the user marks
it as a querier.

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
v3: use non-general query
v2: only send query to the port received leave

 net/bridge/br_multicast.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 6a05522..d73276b 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1250,6 +1250,21 @@  static void br_multicast_leave_group(struct net_bridge *br,
 	if (!mp)
 		goto out;
 
+	if (br->multicast_querier &&
+	    !timer_pending(&br->multicast_querier_timer)) {
+		u32 sent;
+
+		__br_multicast_send_query(br, port, &mp->addr);
+		sent = port ? port->multicast_startup_queries_sent :
+			      br->multicast_startup_queries_sent;
+		time = jiffies;
+		time += sent < br->multicast_startup_query_count ?
+			br->multicast_startup_query_interval :
+			br->multicast_query_interval;
+		mod_timer(port ? &port->multicast_query_timer :
+				 &br->multicast_query_timer, time);
+	}
+
 	if (port && (port->flags & BR_MULTICAST_FAST_LEAVE)) {
 		struct net_bridge_port_group __rcu **pp;