netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@web.de>
To: Jan Beulich <JBeulich@novell.com>
Cc: davem@davemloft.net, shemminger@linux-foundation.org,
	bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
	"Linus Lüssing" <linus.luessing@web.de>
Subject: [PATCH] bridge: Fix possibly wrong MLD queries' ethernet source address
Date: Tue, 22 Mar 2011 22:40:32 +0100	[thread overview]
Message-ID: <1300830032-6727-2-git-send-email-linus.luessing@web.de> (raw)
In-Reply-To: <1300830032-6727-1-git-send-email-linus.luessing@web.de>

The ipv6_dev_get_saddr() is currently called with an uninitialized
destination address. Although in tests it usually seemed to nevertheless
always fetch the right source address, there seems to be a possible race
condition.

Therefore this commit changes this, first setting the destination
address and only after that fetching the source address.

Reported-by: Jan Beulich <JBeulich@novell.com>
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---
 net/bridge/br_multicast.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 030a002..f61eb2e 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -445,9 +445,9 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
 	ip6h->payload_len = htons(8 + sizeof(*mldq));
 	ip6h->nexthdr = IPPROTO_HOPOPTS;
 	ip6h->hop_limit = 1;
+	ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1));
 	ipv6_dev_get_saddr(dev_net(br->dev), br->dev, &ip6h->daddr, 0,
 			   &ip6h->saddr);
-	ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1));
 	ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest);
 
 	hopopt = (u8 *)(ip6h + 1);
-- 
1.5.6.5


  reply	other threads:[~2011-03-22 21:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 12:34 build breakage due to br_multicast.c referencing ipv6_dev_get_saddr() Jan Beulich
2011-03-16 15:24 ` Stephen Hemminger
2011-03-16 17:49   ` David Miller
2011-03-17  7:53     ` Jan Beulich
2011-03-17  8:01   ` Jan Beulich
2011-03-17  8:23     ` Eric Dumazet
2011-03-17 13:00     ` David Miller
2011-03-16 16:41 ` Stephen Hemminger
2011-03-16 17:34 ` Brian Haley
2011-03-17  7:57   ` Jan Beulich
2011-03-17 13:45     ` Brian Haley
2011-03-16 17:49 ` David Miller
2011-03-22 21:40 ` Linus Lüssing
2011-03-22 21:40   ` Linus Lüssing [this message]
2011-03-23  2:26     ` [PATCH] bridge: Fix possibly wrong MLD queries' ethernet source address David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300830032-6727-2-git-send-email-linus.luessing@web.de \
    --to=linus.luessing@web.de \
    --cc=JBeulich@novell.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).