Message ID | 1350479255-904-1-git-send-email-linus.luessing@web.de (mailing list archive) |
---|---|
State | Accepted, archived |
Commit | 9868989393a9a99b9dc33bbcd588ad997d300ffa |
Headers |
Return-Path: <linus.luessing@web.de> Received: from mout.web.de (mout.web.de [212.227.17.12]) by open-mesh.org (Postfix) with ESMTP id F287960147E for <b.a.t.m.a.n@lists.open-mesh.org>; Wed, 17 Oct 2012 15:06:18 +0200 (CEST) Received: from localhost ([93.182.169.51]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0MPGym-1TK5c1498S-00551g; Wed, 17 Oct 2012 15:06:18 +0200 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@web.de> To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 17 Oct 2012 15:07:35 +0200 Message-Id: <1350479255-904-1-git-send-email-linus.luessing@web.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:lzzGbOOqDB/Coc8R0FqitYuZdUf61fdgVJ8DZ7uIeER e8Q+jpq6Gph2mduJOqi8WJDdHiUtXFs/XpETwS/Cu4jPuxnagD CMbySSXvz8K59mArZYet7yuU3SLF4uVlHDEX57hFQv3bQAWh+6 AhcE4yEjbs9f2/sS78F8gzyarxo3Xl89rTLBaAVysA510mtzOs N/pfWQbKcoIQ0U826bgqw== Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Do not add multicast MAC addresses to translation table X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n@lists.open-mesh.org> List-Id: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n.lists.open-mesh.org> List-Unsubscribe: <https://lists.open-mesh.org/mm/options/b.a.t.m.a.n>, <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=unsubscribe> List-Archive: <http://lists.open-mesh.org/pipermail/b.a.t.m.a.n/> List-Post: <mailto:b.a.t.m.a.n@lists.open-mesh.org> List-Help: <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=help> List-Subscribe: <https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n>, <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=subscribe> X-List-Received-Date: Wed, 17 Oct 2012 13:06:19 -0000 |
Commit Message
Linus Lüssing
Oct. 17, 2012, 1:07 p.m. UTC
The current translation table mechanism is not suitable for multicast
addresses and we are currently flooding such frames anyway.
Therefore this patch prevents multicast MAC addresses being added to the
translation table.
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---
soft-interface.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Wed, Oct 17, 2012 at 03:07:35PM +0200, Linus Lüssing wrote: > The current translation table mechanism is not suitable for multicast > addresses and we are currently flooding such frames anyway. > > Therefore this patch prevents multicast MAC addresses being added to the > translation table. > > Signed-off-by: Linus Lüssing <linus.luessing@web.de> > --- > soft-interface.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/soft-interface.c b/soft-interface.c > index 2d1f895..9955319 100644 > --- a/soft-interface.c > +++ b/soft-interface.c > @@ -180,7 +180,8 @@ static int batadv_interface_tx(struct sk_buff *skb, > goto dropped; > > /* Register the client MAC in the transtable */ > - batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); > + if (!is_multicast_ether_addr(ethhdr->h_source)) > + batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); How can the source address be multicast? Usually multicast addresses are found in the destination field... Is there any scenario where this is possible? I am wondering whether we should directly drop packet having mcast address as source.. Cheers,
> Gesendet: Mittwoch, 17. Oktober 2012 um 15:36 Uhr > Von: "Antonio Quartulli" <ordex@autistici.org> > An: "The list for a Better Approach To Mobile Ad-hoc Networking" <b.a.t.m.a.n@lists.open-mesh.org> > Betreff: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Do not add multicast MAC addresses to translation table > > On Wed, Oct 17, 2012 at 03:07:35PM +0200, Linus Lüssing wrote: > > The current translation table mechanism is not suitable for multicast > > addresses and we are currently flooding such frames anyway. > > > > Therefore this patch prevents multicast MAC addresses being added to the > > translation table. > > > > Signed-off-by: Linus Lüssing <linus.luessing@web.de> > > --- > > soft-interface.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/soft-interface.c b/soft-interface.c > > index 2d1f895..9955319 100644 > > --- a/soft-interface.c > > +++ b/soft-interface.c > > @@ -180,7 +180,8 @@ static int batadv_interface_tx(struct sk_buff *skb, > > goto dropped; > > > > /* Register the client MAC in the transtable */ > > - batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); > > + if (!is_multicast_ether_addr(ethhdr->h_source)) > > + batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); > > How can the source address be multicast? Usually multicast addresses are found > in the destination field... > > Is there any scenario where this is possible? I am wondering whether we should > directly drop packet having mcast address as source.. Hm, no, I do not have a specific scenario in mind. I only accidentally noticed such an FF:FF:FF:FF:FF:FF mac address in our vis graph here when I made a typo with the tool 'mausezahn'. I don't know of any RFC or so which would generally forbid using a multicast source MAC for every ether type (although for sane IPv4/v6 stacks I haven't seen something like this before either and yes, I bet it's not allowed there). The Linux bridge I had on top of bat0 was happily forwarding such frames into batman-adv. So I thought doing it like the bridge code - forwarding but with no learning - might be the right way? Cheers > > Cheers, > > > -- > Antonio Quartulli > > ..each of us alone is worth nothing.. > Ernesto "Che" Guevara >
On Wed, Oct 17, 2012 at 08:43:05PM +0200, "Linus Lüssing" wrote: > > > > Gesendet: Mittwoch, 17. Oktober 2012 um 15:36 Uhr > > Von: "Antonio Quartulli" <ordex@autistici.org> > > An: "The list for a Better Approach To Mobile Ad-hoc Networking" <b.a.t.m.a.n@lists.open-mesh.org> > > Betreff: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Do not add multicast MAC addresses to translation table > > > > On Wed, Oct 17, 2012 at 03:07:35PM +0200, Linus Lüssing wrote: > > > The current translation table mechanism is not suitable for multicast > > > addresses and we are currently flooding such frames anyway. > > > > > > Therefore this patch prevents multicast MAC addresses being added to the > > > translation table. > > > > > > Signed-off-by: Linus Lüssing <linus.luessing@web.de> > > > --- > > > soft-interface.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/soft-interface.c b/soft-interface.c > > > index 2d1f895..9955319 100644 > > > --- a/soft-interface.c > > > +++ b/soft-interface.c > > > @@ -180,7 +180,8 @@ static int batadv_interface_tx(struct sk_buff *skb, > > > goto dropped; > > > > > > /* Register the client MAC in the transtable */ > > > - batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); > > > + if (!is_multicast_ether_addr(ethhdr->h_source)) > > > + batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); > > > > How can the source address be multicast? Usually multicast addresses are found > > in the destination field... > > > > Is there any scenario where this is possible? I am wondering whether we should > > directly drop packet having mcast address as source.. > > Hm, no, I do not have a specific scenario in mind. I only accidentally noticed such an FF:FF:FF:FF:FF:FF mac address in our vis graph here when I made a typo with the tool 'mausezahn'. > > I don't know of any RFC or so which would generally forbid using a multicast source MAC for every ether type (although for sane IPv4/v6 stacks I haven't seen something like this before either and yes, I bet it's not allowed there). > > The Linux bridge I had on top of bat0 was happily forwarding such frames into batman-adv. So I thought doing it like the bridge code - forwarding but with no learning - might be the right way? I think you are right. We should not care about the payload logic. If that is not allowed for the upper layer, then that layer will drop the packet once received. So we should keep forwarding such packets and yes, we should prevent learning from them. Therefore: Acked-by: Antonio Quartulli <ordex@autistici.org> Thanks a lot Linüs. Cheers,
On Thursday, October 18, 2012 02:48:39 Antonio Quartulli wrote: > > Hm, no, I do not have a specific scenario in mind. I only accidentally > > noticed such an FF:FF:FF:FF:FF:FF mac address in our vis graph here when > > I made a typo with the tool 'mausezahn'. > > > > > > > > I don't know of any RFC or so which would generally forbid using a > > multicast source MAC for every ether type (although for sane IPv4/v6 > > stacks I haven't seen something like this before either and yes, I bet > > it's not allowed there). > > > > > > > > The Linux bridge I had on top of bat0 was happily forwarding such frames > > into batman-adv. So I thought doing it like the bridge code - forwarding > > but with no learning - might be the right way? > > I think you are right. We should not care about the payload logic. If that > is not allowed for the upper layer, then that layer will drop the packet > once received. > > > So we should keep forwarding such packets and yes, we should prevent > learning from them. Therefore: > > Acked-by: Antonio Quartulli <ordex@autistici.org> Applied in revision 9868989. Thanks, Marek
diff --git a/soft-interface.c b/soft-interface.c index 2d1f895..9955319 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -180,7 +180,8 @@ static int batadv_interface_tx(struct sk_buff *skb, goto dropped; /* Register the client MAC in the transtable */ - batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); + if (!is_multicast_ether_addr(ethhdr->h_source)) + batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif); /* don't accept stp packets. STP does not help in meshes. * better use the bridge loop avoidance ...