Netdev List
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: "Fernando Fernandez Mancera" <fmancera@suse.de>,
	"Beniamino Galvani" <bgalvani@redhat.com>,
	"Íñigo Huguet" <ihuguet@redhat.com>,
	"Thorsten Leemhuis" <regressions@leemhuis.info>,
	"Jakub Kicinski" <kuba@kernel.org>,
	netdev@vger.kernel.org, "Yumei Huang" <yuhuang@redhat.com>,
	"Ido Schimmel" <idosch@idosch.org>,
	"Justin Iurman" <justin.iurman@gmail.com>,
	"David Ahern" <dsahern@kernel.org>,
	"Linux kernel regressions list" <regressions@lists.linux.dev>
Subject: Re: Problem with IPv6 privacy addresses in 7.0
Date: Fri, 29 May 2026 14:47:00 +1000	[thread overview]
Message-ID: <ahkaRG2uFPThVFNA@zatzit> (raw)
In-Reply-To: <20260528212213.4aa613f8@elisabeth>

[-- Attachment #1: Type: text/plain, Size: 6222 bytes --]

On Thu, May 28, 2026 at 09:22:14PM +0200, Stefano Brivio wrote:
> On Thu, 28 May 2026 20:50:48 +0200
> Fernando Fernandez Mancera <fmancera@suse.de> wrote:
> 
> > On 5/28/26 8:42 PM, Fernando Fernandez Mancera wrote:
> > > On 5/28/26 7:21 PM, Stefano Brivio wrote:  
> > >> On Thu, 28 May 2026 18:01:27 +0200 Beniamino Galvani
> > >> <bgalvani@redhat.com> wrote:
> > >>  
> > >>> On Thu, May 28, 2026 at 05:24:28PM +0200, Íñigo Huguet wrote:  
> > >>>> On Thu, May 28, 2026 at 4:53 PM Stefano Brivio
> > >>>> <sbrivio@redhat.com> wrote:  
> > >>>>> I think what's considered UAPI in this case isn't so clear-
> > >>>>> cut. I guess it would have been pretty hard for anybody not
> > >>>>> familiar with NetworkManager's codebase to imagine that an
> > >>>>> application would rely on IPv6 addresses (and only IPv6) to be
> > >>>>> returned in the reverse order.  
> > >>>>
> > >>>> IMHO it's not because an application would rely on the order.
> > >>>> It's because the order matters, as the first one is considered
> > >>>> the primary.  
> > >>
> > >> Yes, that's also the case, but:
> > >>  
> > >>>> This is not NetworkManager specific. Or I am mistaken? I'm
> > >>>> speaking by memory  
> > >>
> > >> ...from what I understood of the issue at hand there's a part that's 
> > >> specific to NetworkManager here, because NetworkManager replaces / 
> > >> deletes the Privacy Extensions addresses, instead of different 
> > >> addresses, because it relies on that specific (reversed) order.
> > >>
> > >> Anyway, yes, I see your point about UAPI now.
> > >>  
> > >>> Yes, exactly. If you do:
> > >>>
> > >>> ip addr add dev X 3fff::1/64 ip addr dev dev X 3fff::2/64
> > >>>
> > >>> then the old kernel chooses the address that was added last as
> > >>> source address for outgoing communications. With the new kernel it
> > >>> chooses the address that was added first.
> > >>>
> > >>> I think that any script or network management tool that cares
> > >>> about the source address selection is impacted. Indeed, the commit
> > >>> had effects on one of the selftests, which had to be modified to
> > >>> change the order of iproute2 invocations.
> > >>>  
> > >>>>>> If the fix must be in NetworkManager, we only need to parse
> > >>>>>> them in non-reverse order like IPv4, I guess.  
> > >>>>>
> > >>>>> But that would then require some form of detection, and, at
> > >>>>> least according to Fernando, isn't the most robust option
> > >>>>> anyway, as ideally NetworkManager shouldn't rely on the order
> > >>>>> at all.  
> > >>>>
> > >>>> True  
> > >>>
> > >>> Correct, if the new behavior is considered better, there should be
> > >>> a way to detect which order must be used. Otherwise userspace
> > >>> tools won't be able to maintain the same behavior with different
> > >>> kernels.  
> > >>
> > >> My remark here is about whether NetworkManager needs to detect this
> > >> at all. If it used timestamps to detect recent / older addresses, as 
> > >> Fernando mentioned, then you wouldn't need any detection at all,
> > >> right? Or is there something else we're missing?
> > >>  
> > > 
> > > Ohno. Now that Beniamino and Iñigo mentioned it, this will likely break
> > > many other environments. In essence, many tools relies on the previous 
> > > ordering to identify which address is the primary one.
> > > 
> > > E.g cloud tooling communicating with the metadata server via IMDS(v2) to 
> > > configure IPv6 primary and secondary addresses. They are likely relying 
> > > on the ordering for that.
> 
> I haven't seen any tool specifically relying on insertion order for
> this so far and I'm having a hard time believing this kind of tooling
> wouldn't rely explicitly on home / care-of addresses or different
> labels -- see RFC 5014 and RFC 6724 Section 5. (or, perhaps clearer,
> the examples in section 10.1, in particular rule 4. and rule 6.
> 
> But I'll look for more convincing examples in a bit (maybe you have some
> at hand?)
> 
> This is all implemented by __ipv6_dev_get_saddr() and friends, by the way.
> 
> > > So maybe we could fix whatever is wrong with NetworkManager and 
> > > temporary addresses order but I don't think this will scale for the 
> > > cloud tooling with the primary/secondary issue.
> > >   
> > >> By the way, if really needed, one could detect that with the
> > >> equivalent of:
> > >>
> > >> ip a a ::2 dev lo && ip a a ::3 dev lo && [ $(ip -6 -j a | jq -rM '.
> > >> [] .addr_info[0].local') = ::3 ] && echo wrong || echo right
> > >>
> > >> ...depending on the application, that's not necessarily practical,
> > >> but so far we have no evidence of any application needing to do that
> > >> at all.
> > > 
> > > Plenty of tools (NetworkManager included) uses netlink so this isn't 
> > > useful for them.
> > > 
> > > For now I am more in favor of the revert and to look for an alternative 
> > > for pasta situation (like using a flag or something). But I am not a 
> > > maintainer so it isn't my call :)
> 
> One question I started wondering about later is: should the flag affect
> insertion or reporting, in case? I think we would need one for
> insertion, otherwise it's not really generic / functional.

I'd certainly agree.  The bug? oddity? inconsistency? is on the
insertion side so the fix should be on that side (whether or not it's
conditional on a new flag).  If we "fixed" it on the reporting side
we'd instead be creating another bug that cancels its effect for some,
but not all, purposes.

The idea of NLM_INSERT_LAST seems marginally less ghastly to me than
NLM_F_DUMP_REVERSED, though I'm not sure I could articulate why.
Perhaps because we could also allow the former for IPv4 too (as a
no-op).

> > *facepalm* I just noticed the "with the equivalent of", disregard this 
> > last part tho.
> 
> Right, yeah, having a netlink implementation makes that a bit more
> convenient. :)
> 
> -- 
> Stefano
> 

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-05-29  4:48 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 13:53 Problem with IPv6 privacy addresses in 7.0 Chris Adams
2026-05-27  0:57 ` Jakub Kicinski
2026-05-27  1:06   ` Chris Adams
2026-05-27  1:31     ` Jakub Kicinski
2026-05-27 21:13       ` Chris Adams
2026-05-27 21:16         ` Fernando Fernandez Mancera
2026-05-27 21:51         ` Jakub Kicinski
2026-05-27 21:51       ` Chris Adams
2026-05-27 21:59         ` Fernando Fernandez Mancera
2026-05-27 23:07           ` Jakub Kicinski
2026-05-28  5:38           ` Stefano Brivio
2026-05-28 10:46             ` Fernando Fernandez Mancera
2026-05-28 11:12               ` Stefano Brivio
2026-05-28 11:29                 ` Fernando Fernandez Mancera
2026-05-28 12:29                   ` Thorsten Leemhuis
2026-05-28 13:32                     ` Stefano Brivio
2026-05-28 14:02                       ` Thorsten Leemhuis
2026-05-28 14:15                       ` Íñigo Huguet
2026-05-28 14:53                         ` Stefano Brivio
2026-05-28 15:24                           ` Íñigo Huguet
2026-05-28 16:01                             ` Beniamino Galvani
2026-05-28 17:21                               ` Stefano Brivio
2026-05-28 18:42                                 ` Fernando Fernandez Mancera
2026-05-28 18:50                                   ` Fernando Fernandez Mancera
2026-05-28 19:22                                     ` Stefano Brivio
2026-05-29  4:47                                       ` David Gibson [this message]
2026-05-29  8:40                                       ` Beniamino Galvani
2026-05-29 17:40                                         ` Stefano Brivio
2026-05-28 14:34                       ` Andrew Lunn
2026-05-28 15:17                         ` Stefano Brivio
2026-05-29  4:48                           ` David Gibson
2026-05-29  9:42                             ` Stefano Brivio
  -- strict thread matches above, loose matches on Subject: below --
2026-05-29 18:28 Tj
2026-05-29 20:04 ` Stefano Brivio
2026-05-29 20:18   ` Tj

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=ahkaRG2uFPThVFNA@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=bgalvani@redhat.com \
    --cc=dsahern@kernel.org \
    --cc=fmancera@suse.de \
    --cc=idosch@idosch.org \
    --cc=ihuguet@redhat.com \
    --cc=justin.iurman@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=sbrivio@redhat.com \
    --cc=yuhuang@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