From: David Gibson <david@gibson.dropbear.id.au>
To: Jon Maloy <jmaloy@redhat.com>
Cc: sbrivio@redhat.com, passt-dev@passt.top
Subject: Re: [PATCH v8 02/14] passt, pasta: Introduce unified multi-address data structures
Date: Thu, 9 Jul 2026 15:56:08 +1000 [thread overview]
Message-ID: <ak833aQ-fdXeRorE@zatzit> (raw)
In-Reply-To: <ak8d3ScQ4kKXqR-z@zatzit>
[-- Attachment #1: Type: text/plain, Size: 2616 bytes --]
On Thu, Jul 09, 2026 at 02:05:11PM +1000, David Gibson wrote:
> On Thu, Jun 25, 2026 at 10:45:07PM -0400, Jon Maloy wrote:
> > As preparation for supporting multiple addresses per interface,
> > we replace the single addr/prefix_len fields with an array. The
> > array consists of a new struct inany_addr_entry containing an
> > address and prefix length, both in inany_addr format.
> >
> > Despite some code refactoring, there are only two real functional
> > changes:
> > - The indicated IPv6 prefix length is now properly stored, instead
> > of being ignored and overridden with the hardcoded value 64, as
> > has been the case until now.
> > - Since even IPv4 addresses now are stored in IPv6 format, we
> > also store the corresponding prefix length in that format,
> > i.e. using the range [96,128] instead of [0,32].
> >
> > In conf_ip6(), the explicit IN6_IS_ADDR_UNSPECIFIED() check on the
> > address at the end of the function is no longer needed: for
> > host-discovered addresses, it is now checked inside the if (!a) block
> > before calling fwd_set_addr(); for user-provided addresses (via -a),
> > validation already rejects unspecified addresses at parse time.
Following up with a more general observation. We've now been through
a bunch of iterations with various problems in the filtering logic of
fwd_get_addr(). On reflection I think the whole idea of a single
"get" function with a couple of mask parameters is flawed. The
conditions we want to filter on are more complex than this, because we
do have both different provenances of address and types of address.
The major use of fwd_get_addr() in these early patches is to replace
direct references to c->ip4.addr, c->ip6.addr or c->ip6.addr_ll. In
later patches, many of these go away, because you instead iterate
through and do something for *all* relevant addresses. So, I'd
suggest instead of trying to make this general-but-actually-it's-not
lookup function you instead insert 3 specific functions: one that
retreives an ip4.addr equivalent address, one an ip6.addr equivalent
and so forth.
That removes the evidently confusing filtering logic of fwd_get_addr()
and makes for smaller and clearer changes in the many places that need
to be changed to use the new data structure. Through the rest of the
patches callers of those will mostly go away, and they can be removed
again.
--
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 --]
next prev parent reply other threads:[~2026-07-09 5:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 2:45 [PATCH v8 00/14] Introduce multiple addresses Jon Maloy
2026-06-26 2:45 ` [PATCH v8 01/14] dhcpv6: Fix reply destination to match client's source address Jon Maloy
2026-07-09 3:01 ` David Gibson
2026-06-26 2:45 ` [PATCH v8 02/14] passt, pasta: Introduce unified multi-address data structures Jon Maloy
2026-07-09 4:05 ` David Gibson
2026-07-09 5:56 ` David Gibson [this message]
2026-07-09 5:59 ` David Gibson
2026-06-26 2:45 ` [PATCH v8 03/14] tap, conf: Replace addr_fixed with CONF_ADDR_USER flag check Jon Maloy
2026-06-26 2:45 ` [PATCH v8 04/14] fwd: Unify guest accessibility checks with unified address array Jon Maloy
2026-06-26 2:45 ` [PATCH v8 05/14] arp: Check all configured addresses in ARP filtering Jon Maloy
2026-06-26 2:45 ` [PATCH v8 06/14] conf: Allow multiple -a/--address options per address family Jon Maloy
2026-06-26 2:45 ` [PATCH v8 07/14] netlink, conf: Read all addresses from template interface at startup Jon Maloy
2026-06-26 2:45 ` [PATCH v8 08/14] netlink, pasta: refactor function pasta_ns_conf() Jon Maloy
2026-06-26 2:45 ` [PATCH v8 09/14] conf, pasta: Track observed guest IPv4 addresses in unified address array Jon Maloy
2026-06-26 2:45 ` [PATCH v8 10/14] conf, pasta: Track observed guest IPv6 " Jon Maloy
2026-06-26 2:45 ` [PATCH v8 11/14] dhcp: Select address for DHCP distribution Jon Maloy
2026-06-26 2:45 ` [PATCH v8 12/14] dhcpv6: Select addresses for DHCPv6 distribution Jon Maloy
2026-06-26 2:45 ` [PATCH v8 13/14] ndp: Support advertising multiple prefixes in Router Advertisements Jon Maloy
2026-06-26 2:45 ` [PATCH v8 14/14] migrate: Update protocol to v3 for multi-address support Jon Maloy
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=ak833aQ-fdXeRorE@zatzit \
--to=david@gibson.dropbear.id.au \
--cc=jmaloy@redhat.com \
--cc=passt-dev@passt.top \
--cc=sbrivio@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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).