From patchwork Tue Mar 22 21:40:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 87961 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C04DBB6F77 for ; Wed, 23 Mar 2011 08:40:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932310Ab1CVVky (ORCPT ); Tue, 22 Mar 2011 17:40:54 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:54524 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755364Ab1CVVkx (ORCPT ); Tue, 22 Mar 2011 17:40:53 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate03.web.de (Postfix) with ESMTP id 15CE018A4972A; Tue, 22 Mar 2011 22:40:52 +0100 (CET) Received: from [46.126.246.98] (helo=localhost) by smtp03.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.110 #2) id 1Q29Jr-00059F-00; Tue, 22 Mar 2011 22:40:51 +0100 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: Jan Beulich Cc: , , , , =?utf-8?q?Linus=20L=C3=BCssing?= Subject: [PATCH] bridge: Fix possibly wrong MLD queries' ethernet source address Date: Tue, 22 Mar 2011 22:40:32 +0100 Message-Id: <1300830032-6727-2-git-send-email-linus.luessing@web.de> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1300830032-6727-1-git-send-email-linus.luessing@web.de> References: <4D80BC5B0200007800036D85@vpn.id2.novell.com> <1300830032-6727-1-git-send-email-linus.luessing@web.de> MIME-Version: 1.0 X-Sender: linus.luessing@web.de X-Provags-ID: V01U2FsdGVkX18UbgRmY/3Q6jKm1W7vF9kpsC7YZijMpdIo1dn8 z1nHkZGjQs2YMou0UDvv/xgBgnSSBC4M5pU5tf3tR9icwrgz85 dKyicDMmZ+24MWJzr4aQ== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Signed-off-by: Linus Lüssing --- 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);