[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<TYCPR01MB8437DA180663B75AECDEB24798D62@TYCPR01MB8437.jpnprd01.prod.outlook.com>
Date: Mon, 10 Mar 2025 22:13:17 +0800
From: Shengyu Qu <wiagn233@...look.com>
To: Felix Fietkau <nbd@....name>, Nikolay Aleksandrov <razor@...ckwall.org>,
netdev@...r.kernel.org, Roopa Prabhu <roopa@...dia.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>
Cc: wiagn233@...look.com, bridge@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: bridge: locally receive all multicast packets if
IFF_ALLMULTI is set
Ping for next version.
在 2025/2/17 20:58, Felix Fietkau 写道:
> On 17.02.25 12:54, Nikolay Aleksandrov wrote:
>> On 2/17/25 13:26, Felix Fietkau wrote:
>>> If multicast snooping is enabled, multicast packets may not always
>>> end up on
>>> the local bridge interface, if the host is not a member of the multicast
>>> group. Similar to how IFF_PROMISC allows all packets to be received
>>> locally,
>>> let IFF_ALLMULTI allow all multicast packets to be received.
>>>
>>> Signed-off-by: Felix Fietkau <nbd@....name>
>>> ---
>>> net/bridge/br_input.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
>>> index 232133a0fd21..7fa2da6985b5 100644
>>> --- a/net/bridge/br_input.c
>>> +++ b/net/bridge/br_input.c
>>> @@ -155,6 +155,8 @@ int br_handle_frame_finish(struct net *net,
>>> struct sock *sk, struct sk_buff *skb
>>> pkt_type = BR_PKT_MULTICAST;
>>> if (br_multicast_rcv(&brmctx, &pmctx, vlan, skb, vid))
>>> goto drop;
>>> + if (br->dev->flags & IFF_ALLMULTI)
>>> + local_rcv = true;
>>> }
>>> }
>>>
>>
>> This doesn't look like a bug fix, IMO it should be for net-next.
>>
>> Also you might miss a mcast stat increase, see the multicast code
>> below, the only case that this would cover is the missing "else"
>> branch of:
>> if ((mdst && mdst->host_joined) ||
>> br_multicast_is_router(brmctx, skb)) {
>> local_rcv = true;
>> DEV_STATS_INC(br->dev, multicast);
>> }
>>
>> So I'd suggest to augment the condition and include this ALLMULTI
>> check there,
>> maybe with a comment to mention that all other cases are covered by
>> the current
>> code so people are not surprised.
> Will do, thanks.
>
>> By the way what is the motivation for supporting this flag? I mean you
>> can
>> make the bridge mcast router and it will receive all mcast anyway.
>
> OpenWrt uses a user space daemon for DHCPv6/RA/NDP handling, and in
> relay mode it sets the ALLMULTI flag in order to receive all relevant
> queries on the network.
> This works for normal network interfaces and non-snooping bridges, but
> not snooping bridges (unless, as you pointed out, multicast routing is
> enabled).
>
> - Felix
Download attachment "OpenPGP_0xE3520CC91929C8E7.asc" of type "application/pgp-keys" (6869 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (841 bytes)
Powered by blists - more mailing lists