All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@web.de>
To: Stephen Hemminger <shemminger@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	bridge@lists.linux-foundation.org
Cc: "YOSHIFUJI Hideaki" <yoshfuji@linux-ipv6.org>,
	netdev@vger.kernel.org, "Linus Lüssing" <linus.luessing@web.de>,
	linux-kernel@vger.kernel.org,
	"Herbert Xu" <herbert@gondor.hengli.com.au>
Subject: [Bridge] [PATCH 1/2] bridge: Fix MLD queries' ethernet source address
Date: Thu, 17 Feb 2011 19:17:51 +0100	[thread overview]
Message-ID: <1297966672-3457-2-git-send-email-linus.luessing@web.de> (raw)
In-Reply-To: <20110215154128.2a28632c@nehalam>

Map the IPv6 header's destination multicast address to an ethernet
source address instead of the MLD queries multicast address.

For instance for a general MLD query (multicast address in the MLD query
set to ::), this would wrongly be mapped to 33:33:00:00:00:00, although
an MLD queries destination MAC should always be 33:33:00:00:00:01 which
matches the IPv6 header's multicast destination ff02::1.

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 b5eb28a..f904a2e 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -435,7 +435,6 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
 	eth = eth_hdr(skb);
 
 	memcpy(eth->h_source, br->dev->dev_addr, 6);
-	ipv6_eth_mc_map(group, eth->h_dest);
 	eth->h_proto = htons(ETH_P_IPV6);
 	skb_put(skb, sizeof(*eth));
 
@@ -449,6 +448,7 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
 	ip6h->hop_limit = 1;
 	ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0);
 	ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1));
+	ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest);
 
 	hopopt = (u8 *)(ip6h + 1);
 	hopopt[0] = IPPROTO_ICMPV6;		/* next hdr */
-- 
1.7.2.3


WARNING: multiple messages have this Message-ID (diff)
From: "Linus Lüssing" <linus.luessing@web.de>
To: Stephen Hemminger <shemminger@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	bridge@lists.linux-foundation.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Herbert Xu" <herbert@gondor.hengli.com.au>,
	"YOSHIFUJI Hideaki" <yoshfuji@linux-ipv6.org>,
	"Linus Lüssing" <linus.luessing@web.de>
Subject: [PATCH 1/2] bridge: Fix MLD queries' ethernet source address
Date: Thu, 17 Feb 2011 19:17:51 +0100	[thread overview]
Message-ID: <1297966672-3457-2-git-send-email-linus.luessing@web.de> (raw)
In-Reply-To: <20110215154128.2a28632c@nehalam>

Map the IPv6 header's destination multicast address to an ethernet
source address instead of the MLD queries multicast address.

For instance for a general MLD query (multicast address in the MLD query
set to ::), this would wrongly be mapped to 33:33:00:00:00:00, although
an MLD queries destination MAC should always be 33:33:00:00:00:01 which
matches the IPv6 header's multicast destination ff02::1.

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 b5eb28a..f904a2e 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -435,7 +435,6 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
 	eth = eth_hdr(skb);
 
 	memcpy(eth->h_source, br->dev->dev_addr, 6);
-	ipv6_eth_mc_map(group, eth->h_dest);
 	eth->h_proto = htons(ETH_P_IPV6);
 	skb_put(skb, sizeof(*eth));
 
@@ -449,6 +448,7 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
 	ip6h->hop_limit = 1;
 	ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0);
 	ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1));
+	ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest);
 
 	hopopt = (u8 *)(ip6h + 1);
 	hopopt[0] = IPPROTO_ICMPV6;		/* next hdr */
-- 
1.7.2.3


WARNING: multiple messages have this Message-ID (diff)
From: "Linus Lüssing" <linus.luessing@web.de>
To: Stephen Hemminger <shemminger@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	bridge@lists.linux-foundation.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"YOSHIFUJI Hideaki" <yoshfuji@linux-ipv6.org>,
	"Linus Lüssing" <linus.luessing@web.de>
Subject: [PATCH 1/2] bridge: Fix MLD queries' ethernet source address
Date: Thu, 17 Feb 2011 19:17:51 +0100	[thread overview]
Message-ID: <1297966672-3457-2-git-send-email-linus.luessing@web.de> (raw)
In-Reply-To: <20110215154128.2a28632c@nehalam>

Map the IPv6 header's destination multicast address to an ethernet
source address instead of the MLD queries multicast address.

For instance for a general MLD query (multicast address in the MLD query
set to ::), this would wrongly be mapped to 33:33:00:00:00:00, although
an MLD queries destination MAC should always be 33:33:00:00:00:01 which
matches the IPv6 header's multicast destination ff02::1.

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 b5eb28a..f904a2e 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -435,7 +435,6 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
 	eth = eth_hdr(skb);
 
 	memcpy(eth->h_source, br->dev->dev_addr, 6);
-	ipv6_eth_mc_map(group, eth->h_dest);
 	eth->h_proto = htons(ETH_P_IPV6);
 	skb_put(skb, sizeof(*eth));
 
@@ -449,6 +448,7 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
 	ip6h->hop_limit = 1;
 	ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0);
 	ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1));
+	ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest);
 
 	hopopt = (u8 *)(ip6h + 1);
 	hopopt[0] = IPPROTO_ICMPV6;		/* next hdr */
-- 
1.7.2.3


  parent reply	other threads:[~2011-02-17 18:17 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 23:19 [Bridge] Multicast snooping fixes and suggestions Linus Lüssing
2011-02-15 23:19 ` Linus Lüssing
2011-02-15 23:19 ` Linus Lüssing
2011-02-15 23:19 ` [Bridge] [PATCH 1/5] bridge: Fix IPv6 multicast snooping by storing correct protocol type Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19 ` [Bridge] [PATCH 2/5] bridge: Fix IPv6 multicast snooping by correcting offset in MLDv2 report Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19 ` [Bridge] [PATCH 3/5] bridge: Add missing ntohs()s for MLDv2 report parsing Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19 ` [Bridge] [PATCH 4/5] ipv6: Add IPv6 multicast address flag defines Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19 ` [Bridge] [PATCH 5/5] bridge: Allow mcast snooping for transient link local addresses too Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:19   ` Linus Lüssing
2011-02-15 23:41 ` [Bridge] Multicast snooping fixes and suggestions Stephen Hemminger
2011-02-15 23:41   ` Stephen Hemminger
2011-02-17 18:17   ` [Bridge] " Linus Lüssing
2011-02-17 18:17     ` Linus Lüssing
2011-02-17 18:17     ` Linus Lüssing
2011-02-17 18:17   ` Linus Lüssing [this message]
2011-02-17 18:17     ` [PATCH 1/2] bridge: Fix MLD queries' ethernet source address Linus Lüssing
2011-02-17 18:17     ` Linus Lüssing
2011-02-22 18:08     ` [Bridge] " David Miller
2011-02-22 18:08       ` David Miller
2011-02-22 18:08       ` David Miller
2011-02-17 18:17   ` [Bridge] [PATCH 2/2] bridge: Use IPv6 link-local address for multicast listener queries Linus Lüssing
2011-02-17 18:17     ` Linus Lüssing
2011-02-17 18:17     ` Linus Lüssing
2011-02-22 18:08     ` [Bridge] " David Miller
2011-02-22 18:08       ` David Miller
2011-02-22 18:08       ` David Miller
2011-02-22 18:08 ` [Bridge] Multicast snooping fixes and suggestions David Miller
2011-02-22 18:08   ` David Miller
2011-02-22 18:08   ` David Miller
2011-02-24  3:16 ` [Bridge] " H. Peter Anvin
2011-02-24  3:16   ` H. Peter Anvin
2011-02-24  4:04   ` [Bridge] " Herbert Xu
2011-02-24  4:04     ` Herbert Xu
2011-02-24  4:04     ` Herbert Xu
2011-02-24  4:46     ` [Bridge] " H. Peter Anvin
2011-02-24  4:46       ` H. Peter Anvin
2011-02-24  5:42       ` [Bridge] " Herbert Xu
2011-02-24  5:42         ` Herbert Xu
2011-02-24  5:42         ` Herbert Xu
2011-02-24  5:57         ` [Bridge] " H. Peter Anvin
2011-02-24  5:57           ` H. Peter Anvin
2011-02-24  6:37           ` [Bridge] " Stephen Hemminger
2011-02-24  6:37             ` Stephen Hemminger

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=1297966672-3457-2-git-send-email-linus.luessing@web.de \
    --to=linus.luessing@web.de \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    --cc=yoshfuji@linux-ipv6.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.