public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Guillaume Nault <gnault@redhat.com>
To: Ido Schimmel <idosch@idosch.org>
Cc: Aiden Yang <ling@moedove.com>,
	netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com,
	davem@davemloft.net, MoeDove NOC <noc@moedove.com>
Subject: Re: [BUG] net: gre: IPv6 link-local multicast is silently dropped (Regression)
Date: Mon, 30 Jun 2025 13:54:58 +0200	[thread overview]
Message-ID: <aGJ7EvpKRWVzPm4Y@debian> (raw)
In-Reply-To: <aGFSgDRR8kLc1GxP@shredder>

On Sun, Jun 29, 2025 at 05:49:36PM +0300, Ido Schimmel wrote:
> + Guillaume
> 
> Report is here: https://lore.kernel.org/netdev/CANR=AhRM7YHHXVxJ4DmrTNMeuEOY87K2mLmo9KMed1JMr20p6g@mail.gmail.com/
> 
> On Sun, Jun 29, 2025 at 02:40:27PM +0800, Aiden Yang wrote:
> > This report details a regression in the Linux kernel that prevents
> > IPv6 link-local all-nodes multicast packets (ff02::1) from being
> > transmitted over a GRE tunnel. The issue is confirmed to have been
> > introduced between kernel versions 6.1.0-35-cloud-amd64 (working) and
> > 6.1.0-37-cloud-amd64 (failing) on Debian 12 (Bookworm).
> 
> Apparently 6.1.0-35-cloud-amd64 is v6.1.137 and 6.1.0-37-cloud-amd64 is
> v6.1.140. Probably started with:
> 
> a51dc9669ff8 gre: Fix again IPv6 link-local address generation.
> 
> In v6.1.139.
> 
> It skips creating an IPv6 multicast route for some ipgre devices. Can
> you try the following diff?
> 
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index ba2ec7c870cc..d0a202d0d93e 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -3537,12 +3537,10 @@ static void addrconf_gre_config(struct net_device *dev)
>  	 * case). Such devices fall back to add_v4_addrs() instead.
>  	 */
>  	if (!(dev->type == ARPHRD_IPGRE && *(__be32 *)dev->dev_addr == 0 &&
> -	      idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_EUI64)) {
> +	      idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_EUI64))
>  		addrconf_addr_gen(idev, true);
> -		return;
> -	}
> -
> -	add_v4_addrs(idev);
> +	else
> +		add_v4_addrs(idev);
>  
>  	if (dev->flags & IFF_POINTOPOINT)
>  		addrconf_add_mroute(dev);

I believe that should fix the problem indeed. But, to me, the root
cause is that addrconf_gre_config() doesn't call addrconf_add_dev().

Ido, What do you think of something like the following (untested,
hand-written) diff:

 #if IS_ENABLED(CONFIG_NET_IPGRE)
 static void addrconf_gre_config(struct net_device *dev)
 {
 	struct inet6_dev *idev;
 
 	ASSERT_RTNL();
 
-	idev = ipv6_find_idev(dev);
-	if (IS_ERR(idev)) {
-		pr_debug("%s: add_dev failed\n", __func__);
-		return;
-	}
+	idev = addrconf_add_dev(dev);
+	if (IS_ERR(idev))
+		return;
 
 	/* Generate the IPv6 link-local address using addrconf_addr_gen(),
 	 * unless we have an IPv4 GRE device not bound to an IP address and
 	 * which is in EUI64 mode (as __ipv6_isatap_ifid() would fail in this
 	 * case). Such devices fall back to add_v4_addrs() instead.
 	 */
 	if (!(*(__be32 *)dev->dev_addr == 0 &&
 	      idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_EUI64)) {
 		addrconf_addr_gen(idev, true);
 		return;
 	}
 
 	add_v4_addrs(idev);
-
-	if (dev->flags & IFF_POINTOPOINT)
-		addrconf_add_mroute(dev);
 }
 #endif

This way, we would create the multicast route and also respect
disable_ipv6. That would bring GRE yet a bit closer to normal IPv6
lladdr generation code.

Note: this diff is based on net-next, but, without all the extra
context lines, a real patch would probably apply to both net and
next-next and could be backported to -stable.

> Guillaume, AFAICT, after commit d3623dd5bd4e ("ipv6: Simplify link-local
> address generation for IPv6 GRE.") in net-next an IPv6 multicast route
> will be created for every ip6gre device, regardless of IFF_POINTOPOINT.
> It should restore the behavior before commit e5dd729460ca ("ip/ip6_gre:
> use the same logic as SIT interfaces when computing v6LL address"). We
> can extend gre_ipv6_lladdr.sh to test this once the fix is in net-next.

Yes, I fully agree.

Long term, I'd really like to remove these special GRE and SIT cases
(SIT certainly has the same problems we're currently fixing on GRE).


  reply	other threads:[~2025-06-30 11:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-29  6:40 [BUG] net: gre: IPv6 link-local multicast is silently dropped (Regression) Aiden Yang
2025-06-29 14:49 ` Ido Schimmel
2025-06-30 11:54   ` Guillaume Nault [this message]
2025-07-01 10:13     ` Ido Schimmel
2025-07-02 10:12       ` Guillaume Nault
2025-07-06 15:40         ` Gary Guo
2025-07-09 14:15           ` Guillaume Nault

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=aGJ7EvpKRWVzPm4Y@debian \
    --to=gnault@redhat.com \
    --cc=davem@davemloft.net \
    --cc=idosch@idosch.org \
    --cc=kuba@kernel.org \
    --cc=ling@moedove.com \
    --cc=netdev@vger.kernel.org \
    --cc=noc@moedove.com \
    --cc=pabeni@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox