From: Stefano Brivio <sbrivio@redhat.com>
To: Ido Schimmel <idosch@nvidia.com>
Cc: David Gibson <david@gibson.dropbear.id.au>,
Fernando Fernandez Mancera <fmancera@suse.de>,
netdev@vger.kernel.org, yuhuang@redhat.com,
justin.iurman@gmail.com, horms@kernel.org, pabeni@redhat.com,
kuba@kernel.org, edumazet@google.com, davem@davemloft.net,
dsahern@kernel.org, Chris Adams <linux@cmadams.net>,
Beniamino Galvani <bgalvani@redhat.com>,
Thorsten Leemhuis <regressions@leemhuis.info>,
Andrew Lunn <andrew@lunn.ch>,
ihuguet@redhat.com, regressions@lists.linux.dev,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Matthieu Baerts <matttbe@kernel.org>
Subject: Re: IPv6 address insertion order (was Re: [PATCH net v2] Revert "ipv6: preserve insertion order for same-scope addresses")
Date: Fri, 05 Jun 2026 12:13:26 +0200 (CEST) [thread overview]
Message-ID: <20260605121325.3d426dc4@elisabeth> (raw)
In-Reply-To: <20260604183909.GA877115@shredder>
On Thu, 4 Jun 2026 21:39:09 +0300
Ido Schimmel <idosch@nvidia.com> wrote:
> On Thu, Jun 04, 2026 at 11:26:08AM +1000, David Gibson wrote:
> > So, I second Stefano's arguments for the most part, as well as
> > re-iterating that being broken by this change would require the
> > intersection of two unlikely conditions (misusing NLM_F_APPEND *and*
> > expecting the "wrong" order).
> >
> > That said, Ido, if you're still not convinced I can do this as an
> > attribute. It's more hassle, but I can make it work.
>
> I appreciate the survey that Stefano and you conducted, but there is
> still a non-zero chance of causing regressions by suddenly giving
> NLM_F_APPEND a meaning in RTM_NEWADDR. We already tried the
> "change-and-see-what-happens" methodology once with this feature and it
> backfired, so it's going to be quite painful if we miss again.
>
> As I see it, we have three options:
Thanks for the helpful summary by the way.
> 1. Use NLM_F_APPEND. Relatively easy change in both the kernel and user
> space, but at the risk of reintroducing regressions.
>
> 2. Add a new attribute (e.g., IFA_INSERT_MODE with DEFAULT/APPEND
> options). Less risky than #1, at the cost of a bit more code in both the
> kernel and user space.
>
> 3. Do nothing. As I understand it, any production software (as opposed
> to a test script) that cares about the in-scope order will have to
> maintain a fallback anyway (e.g., iterating over IPv6 addresses in
> reverse).
It's not always enough, or needed, or practical, though:
a. 'ip address restore' could be "fixed" to load the addresses in a
reversed order for IPv6, but what should 'ip address showdump' do at
that point?
Also reverse the order? Or not, because that's the order addresses
were dumped in? I'm fairly sure 'ip address save' shouldn't reverse
it. It would be more convenient for the other operations, but
definitely wrong, because the kernel is picking addresses in the
opposite order.
All these are doable, some look questionable, but any of the possible
workarounds looks hard to document, or even remember.
b. as to pasta(1) and passt(1): the regression introduced by the revert
of the kernel change isn't a big one: after all, we had the right
behaviour for just a few months.
Similarly, if the kernel gives us a way to get it right, we would
just stick to it for the future and be done with it. Adding a
workaround for older kernels isn't a priority because there was no
regression.
Side note: the workaround would be rather impractical for us because
we don't use dynamic memory allocation, but we certainly can't blame
the kernel or anybody else for that.
c. regardless of how addresses are dumped to userspace, there would be
no way to get the kernel to do what one reasonably expects it to do
(also from established IPv4 practice): *use* addresses in order of
insertion
By the way of c., you're explicitly excluding test scripts as they are
certainly less important, but does it really make sense to force people
to to maintain the kind of workaround Matthieu mentioned? Reporting it
here for convenience:
https://github.com/multipath-tcp/packetdrill/commit/1b7cd4482ce8
> Therefore, the changes in #1 and #2 are not strictly
> necessary, yet they are uAPI that the kernel will have to maintain
> forever.
>
> Given the above, my preference would be #3 -> #2 -> #1. The first two
> options expose the same capability to user space, so #1 doesn't buy us
> anything over #2, except a bit less code, but we risk introducing a
> regression.
>
> Between #2 and #3, production software can't drop the fallback even if
> we implement #2, yet #2 requires us to maintain uAPI forever. I think we
> should accept that the divergence between IPv4 and IPv6 is not ideal,
> but at least it's predictable and dependable (Fernando is working on a
> ksft and documentation).
>
> That being said, you can send an RFC for #1 and see what others think
> since at this point it's unclear who is still following the thread.
I think there's general consensus against #1 ("abusing" NLM_F_APPEND),
but still, I think #2 is very much needed and fundamentally harmless.
--
Stefano
next prev parent reply other threads:[~2026-06-05 10:13 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 11:23 [PATCH net v2] Revert "ipv6: preserve insertion order for same-scope addresses" Fernando Fernandez Mancera
2026-05-29 11:41 ` Stefano Brivio
2026-05-29 11:45 ` Fernando Fernandez Mancera
2026-05-29 12:06 ` Chris Adams
2026-06-01 2:03 ` Matthieu Baerts
2026-06-01 13:35 ` Stefano Brivio
2026-06-01 14:01 ` Íñigo Huguet
2026-06-01 14:22 ` Thorsten Leemhuis
2026-06-03 5:46 ` Matthieu Baerts
2026-06-03 6:53 ` Íñigo Huguet
2026-06-03 7:17 ` Thorsten Leemhuis
2026-06-03 7:29 ` Fernando Fernandez Mancera
2026-06-03 8:00 ` Ido Schimmel
2026-06-03 8:06 ` Fernando Fernandez Mancera
2026-06-03 9:27 ` Matthieu Baerts
2026-06-03 8:02 ` David Gibson
2026-06-02 6:44 ` IPv6 address insertion order (was Re: [PATCH net v2] Revert "ipv6: preserve insertion order for same-scope addresses") David Gibson
2026-06-02 12:46 ` Andrew Lunn
2026-06-03 1:56 ` David Gibson
2026-06-02 13:21 ` Ido Schimmel
2026-06-03 2:34 ` David Gibson
2026-06-03 7:47 ` Ido Schimmel
2026-06-03 15:45 ` Stefano Brivio
2026-06-04 1:26 ` David Gibson
2026-06-04 18:39 ` Ido Schimmel
2026-06-04 22:55 ` Jakub Kicinski
2026-06-05 10:13 ` Stefano Brivio [this message]
2026-06-03 15:47 ` Nicolas Dichtel
2026-05-29 20:20 ` [PATCH net v2] Revert "ipv6: preserve insertion order for same-scope addresses" patchwork-bot+netdevbpf
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=20260605121325.3d426dc4@elisabeth \
--to=sbrivio@redhat.com \
--cc=andrew@lunn.ch \
--cc=bgalvani@redhat.com \
--cc=davem@davemloft.net \
--cc=david@gibson.dropbear.id.au \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=fmancera@suse.de \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=ihuguet@redhat.com \
--cc=justin.iurman@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@cmadams.net \
--cc=matttbe@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=regressions@leemhuis.info \
--cc=regressions@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.