Return-path: Received: from mail.aperture-lab.de ([138.201.29.205]:34886 "EHLO mail.aperture-lab.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750821AbdAIXMG (ORCPT ); Mon, 9 Jan 2017 18:12:06 -0500 Date: Tue, 10 Jan 2017 00:12:03 +0100 From: Linus =?utf-8?Q?L=C3=BCssing?= To: Johannes Berg Cc: netdev@vger.kernel.org, "David S . Miller" , Stephen Hemminger , bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Felix Fietkau , Michael Braun Subject: Re: [PATCH net-next] bridge: multicast to unicast Message-ID: <20170109231203.GC5513@otheros> (sfid-20170110_001238_347228_AD01F55F) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: <1483965843.17582.37.camel@sipsolutions.net> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, Jan 09, 2017 at 10:42:46PM +0100, Johannes Berg wrote: > On Mon, 2017-01-09 at 22:33 +0100, Linus Lüssing wrote: > > On Mon, Jan 09, 2017 at 01:44:03PM +0100, Johannes Berg wrote: > > > > > > > >          A host SHOULD silently discard a datagram that is > > > > > received via > > > > >          a link-layer broadcast (see Section 2.4) but does not > > > > > specify > > > > >          an IP multicast or broadcast destination address. > > > > > > > > This example is the other way round. It specifies how the IP > > > > destination should look like in case of link-layer broadcast. Not > > > > how the link-layer destination should look like in case of a > > > > multicast/broadcast IP destination. > > > > > > You stopped reading too early - snipped the context part for you :) > > > > Sorry for writing to you directly, but I still have some > > difficulties. In pseudo-code that line says: > > > > ----- > > if ll_dst(pkt) == bcast AND ip_dst(pkt) != mcast/bcast: > > -> drop(pkt) > > ----- > > > > But after multicast-to-unicast conversion, we have: > > > > ----- > > ll_dst(pkt) == ucast AND ip_dst(pkt) == mcast > > ----- > > > > So none of the two requirements for dropping are matched? > > > > Exactly. My point is that this is breaking the expectation that hosts > are actually able to drop such packets. [readding CCs I removed earlier] Ah! Thanks. I was worried about creating packetloss :D. Hm, for this other other way round, I think it does not apply for the bridge multicast-to-unicast patch if I'm not misreading the bridge code: For a packet with a link-layer multicast address but a unicast IP destination, the bridge MDB lookup will fail. (http://lxr.free-electrons.com/source/net/bridge/br_multicast.c?v=4.8#L178 returns NULL) Case A): No multicast router on port: -> bridge, br_multicast_flood(), will drop the packet already (no matter if multicast-to-unicast is enabled or not) Case B): Multicast router present on port: -> The new patch does not apply multicast-to-unicast but just floods packet unaltered ("else { port = rport; addr = NULL; }" branch) Regards, Linus