netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net-next 1/3] bridge: use the bridge IP addr as source addr of querier
@ 2013-04-29  7:26 Cong Wang
  2013-04-29  7:26 ` [Patch net-next 2/3] bridge: only expire the mdb entry when query is received Cong Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Cong Wang @ 2013-04-29  7:26 UTC (permalink / raw)
  To: netdev
  Cc: Herbert Xu, Stephen Hemminger, David S. Miller, Adam Baker,
	Cong Wang

From: Cong Wang <amwang@redhat.com>

Quote from Adam:
"If it is believed that the use of 0.0.0.0
as the IP address is what is causing strange behaviour on other devices
then is there a good reason that a bridge rather than a router shouldn't
be the active querier? If not then using the bridge IP address and
having the querier enabled by default may be a reasonable solution
(provided that our querier obeys the election rules and shuts up if it
sees a query from a lower IP address that isn't 0.0.0.0). Just because a
device is the elected querier for IGMP doesn't appear to mean it is
required to perform any other routing functions."

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>
---
 net/bridge/br_multicast.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 81f2389..6cb937c 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -23,6 +23,7 @@
 #include <linux/skbuff.h>
 #include <linux/slab.h>
 #include <linux/timer.h>
+#include <linux/inetdevice.h>
 #include <net/ip.h>
 #if IS_ENABLED(CONFIG_IPV6)
 #include <net/ipv6.h>
@@ -381,7 +382,7 @@ static struct sk_buff *br_ip4_multicast_alloc_query(struct net_bridge *br,
 	iph->frag_off = htons(IP_DF);
 	iph->ttl = 1;
 	iph->protocol = IPPROTO_IGMP;
-	iph->saddr = 0;
+	iph->saddr = inet_select_addr(br->dev, 0, RT_SCOPE_LINK);
 	iph->daddr = htonl(INADDR_ALLHOSTS_GROUP);
 	((u8 *)&iph[1])[0] = IPOPT_RA;
 	((u8 *)&iph[1])[1] = 4;
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-30  3:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29  7:26 [Patch net-next 1/3] bridge: use the bridge IP addr as source addr of querier Cong Wang
2013-04-29  7:26 ` [Patch net-next 2/3] bridge: only expire the mdb entry when query is received Cong Wang
2013-04-30  3:17   ` Cong Wang
2013-04-30  3:22     ` Herbert Xu
2013-04-30  3:32       ` Cong Wang
2013-04-29  7:26 ` [Patch net-next 3/3] bridge: send query as soon as leave " Cong Wang
2013-04-29  7:43   ` Herbert Xu
2013-04-29  8:15     ` Cong Wang
2013-04-29  7:43 ` [Patch net-next 1/3] bridge: use the bridge IP addr as source addr of querier Herbert Xu
2013-04-29  8:17   ` Cong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).