🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Simon Horman Thu, 19 Nov 2026 10:42
Re: [PATCH net 1/1] ipv6: mcast: use resolved interface for source filters
#19104
Author: Simon Horman
Date: Thu, 19 Nov 2026 10:42
57 lines
9926 bytes
On Thu, Nov 12, 2026 at 03:19:04PM +0000, Zihan Xi wrote:
> When no interface is specified, ip6_mc_source() resolves the multicast
> route to an interface but searches socket memberships with a wildcard
> index. A socket joined to the same group on multiple interfaces can
> therefore update its source filter on a different interface from the
> interface filter.
> 
> Use the resolved interface index for the membership lookup and for
> dropping the membership after leaving the last source.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")

Hi Zihan,

I see that Paolo has responded, and his comments should stand.
But I had been looking into this patch and I think it's worth
sharing two points, in case they turn out to be useful in future.

There is an AI-generated review of this patch available at
https://sashiko.dev/#/patchset/cover.1794738094.git.zihanx%40nebusec.ai

It states:

  Furthermore, the duplicate membership check with ifindex == 0 in
  ipv6_sock_mc_join(), the -EADDRINUSE handling in MCAST_JOIN_SOURCE_GROUP,
  and the leavegroup handling in ip6_mc_source() were introduced later by
  c9e3e8b6958e ("[IPV6]: multicast join and misc"), while
  ipv6_sock_mc_join_ssm() was introduced by c7ea20c9da5b ("ipv6/mcast: init
  as INCLUDE when join SSM INCLUDE group").  Should the Fixes: tag point to
  those commits instead?

I would lean towards using c9e3e8b6958e as the Fixes tag as it seems to me
that is the commit that that first introduced this bug.

> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
> ---
>  net/ipv6/mcast.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> index ecef55f26189..63770b3a7bb2 100644
> --- a/net/ipv6/mcast.c
> +++ b/net/ipv6/mcast.c
> @@ -362,6 +362,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
>  	struct net *net = sock_net(sk);
>  	struct ipv6_mc_socklist *pmc;
>  	struct inet6_dev *idev;
> +	int ifindex;
>  	int leavegroup = 0;
>  	int i, j;
>  	int err;

For reference, please preserve reverse xmas tree - longest line to shortest -
ordering for local variable declarations in Networking code.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads