e7af473
From 6b7df111ece130fa979a0c4f58e53674c1e47d3e Mon Sep 17 00:00:00 2001
e7af473
From: Cong Wang <amwang@redhat.com>
e7af473
Date: Tue, 21 May 2013 21:52:56 +0000
e7af473
Subject: bridge: send query as soon as leave is received
e7af473
e7af473
Continue sending queries when leave is received if the user marks
e7af473
it as a querier.
e7af473
e7af473
Cc: Herbert Xu <herbert@gondor.apana.org.au>
e7af473
Cc: Stephen Hemminger <stephen@networkplumber.org>
e7af473
Cc: "David S. Miller" <davem@davemloft.net>
e7af473
Cc: Adam Baker <linux@baker-net.org.uk>
e7af473
Signed-off-by: Cong Wang <amwang@redhat.com>
e7af473
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
e7af473
Signed-off-by: David S. Miller <davem@davemloft.net>
e7af473
---
e7af473
(limited to 'net/bridge')
e7af473
e7af473
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
e7af473
index 40bda80..37a4676 100644
e7af473
--- a/net/bridge/br_multicast.c
e7af473
+++ b/net/bridge/br_multicast.c
e7af473
@@ -1250,6 +1250,32 @@ static void br_multicast_leave_group(struct net_bridge *br,
e7af473
 	if (!mp)
e7af473
 		goto out;
e7af473
 
e7af473
+	if (br->multicast_querier &&
e7af473
+	    !timer_pending(&br->multicast_querier_timer)) {
e7af473
+		__br_multicast_send_query(br, port, &mp->addr);
e7af473
+
e7af473
+		time = jiffies + br->multicast_last_member_count *
e7af473
+				 br->multicast_last_member_interval;
e7af473
+		mod_timer(port ? &port->multicast_query_timer :
e7af473
+				 &br->multicast_query_timer, time);
e7af473
+
e7af473
+		for (p = mlock_dereference(mp->ports, br);
e7af473
+		     p != NULL;
e7af473
+		     p = mlock_dereference(p->next, br)) {
e7af473
+			if (p->port != port)
e7af473
+				continue;
e7af473
+
e7af473
+			if (!hlist_unhashed(&p->mglist) &&
e7af473
+			    (timer_pending(&p->timer) ?
e7af473
+			     time_after(p->timer.expires, time) :
e7af473
+			     try_to_del_timer_sync(&p->timer) >= 0)) {
e7af473
+				mod_timer(&p->timer, time);
e7af473
+			}
e7af473
+
e7af473
+			break;
e7af473
+		}
e7af473
+	}
e7af473
+
e7af473
 	if (port && (port->flags & BR_MULTICAST_FAST_LEAVE)) {
e7af473
 		struct net_bridge_port_group __rcu **pp;
e7af473
 
e7af473
--
e7af473
cgit v0.9.2