From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=dNBpjXSx; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id EE48A5A0262 for ; Tue, 10 Mar 2026 03:30:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1773109843; bh=d6koCeuSvbXb7DRmSsv+f9FVNFqeAe6MeHjNGHVKKG4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dNBpjXSxd5+p+HOS/zQyMPVV8V8qQ64sk0+hWYXjOqs2Pos3nuxvRiPw+jmVgfur2 UAn/X5lLvWzMOIQTu+ghXfB/PqLmoCQCLJy4tfgBzbl/z1uvbVZOgtKIB3mzrIRzfB dGUGQhyaZM9K9iQZbPNhUTyPX+pPzwtLQ5C9blkpBBnqW2UZ+hpVfUVfOuvCT//O+D /jJnKS03ceoUevu1sJV9WuYZEvTvvzQ8TWig5M8K4CDbDArxshJExgZrDNXTfZ7rRU xBINqS38Rr2I2JAAcnHI+LjSZ4TnrK79SoU77+RE3yO37z7ZdWHxJc1nn+H9+k5RbV lykshG6kE0YUQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4fVHtC6Kj5z4wDN; Tue, 10 Mar 2026 13:30:43 +1100 (AEDT) Date: Tue, 10 Mar 2026 12:54:06 +1100 From: David Gibson To: Jon Maloy Subject: Re: [PATCH v3] netlink: Return prefix length for IPv6 addresses in nl_addr_get() Message-ID: References: <20260307184157.1675234-1-jmaloy@redhat.com> <20260309105606.20a31e16@elisabeth> <6d36304d-af80-4ee0-8729-ca551c32d711@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pv/EksRKKho1AJAU" Content-Disposition: inline In-Reply-To: <6d36304d-af80-4ee0-8729-ca551c32d711@redhat.com> Message-ID-Hash: LR2VLJNZEE6KXXN2DSHT55SIC5HTI4JW X-Message-ID-Hash: LR2VLJNZEE6KXXN2DSHT55SIC5HTI4JW X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Stefano Brivio , dgibson@redhat.com, passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --pv/EksRKKho1AJAU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 09, 2026 at 02:04:40PM -0400, Jon Maloy wrote: >=20 >=20 > On 2026-03-09 05:56, Stefano Brivio wrote: > > The patch looks good to me now, but I have two questions: > >=20 > > On Sat, 7 Mar 2026 13:41:57 -0500 > > Jon Maloy wrote: > >=20 > > > nl_addr_get() was not setting the prefix_len output parameter for > > > IPv6 addresses, only for IPv4. This meant callers always got 0 for > > > IPv6, forcing them to use a hardcoded default (64). > > >=20 > > > Fix by assigning *prefix_len even in the IPv6 case. > > >=20 > > > We also add another functional change. We now check for if an AF_INET > > > address is link local, in which case we have to skip it. > >=20 > > The reason why the original code skipped IPv6 link-local addresses and > > not IPv4 link-local ones is that copying a IPv6 link-local address > > clearly makes no sense and breaks things. > >=20 > > For IPv4 I wasn't quite sure, and it seemed to work just like other > > addresses, so I never took care of excluding them. > >=20 > > I tend to think it's correct to exclude them, also for consistency with > > IPv6, but I'm not quite sure if we risk breaking something. I have some > > vague recollection of link-local addresses being used in some cloud > > (probably Google Computing Platform), at least for some Podman tests. > > I'll try to find some pointers to it. > >=20 > > Did you already look into the matter, though? >=20 > Honestly I though it was just an oversight. >=20 >=20 > >=20 > > By the way, this makes things inconsistent with nl_addr_dup() (used by > > the vast majority of users), where IPv4 link-local addresses are copied > > just like all the other ones. > >=20 > > > Although it > > > is conventional to set the scope of such addresses to RT_SCOPE_LINK, > >=20 > > You mean that users manually do that? I think it's kind of rare > > actually. Does the kernel do that? Or configuration agents such as > > NetworkManager? I wonder a bit what you consider as "user" here. >=20 > It is normally set by NetworkManager, Or, presumably by ip(8). > but I don't think that means we > can trust it at 100%. Actually, I think this means we should trust it more. I'd see this as an explicit indication that regardless of any normal conventions, it's being treated as a link-local address in the configuration of this specific host, so we should too. That's moot for the current patch, based on our earlier discussions, but I think it's a relevant point for what we do in future. --=20 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 --pv/EksRKKho1AJAU Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmmvebYACgkQzQJF27ox 2GesIBAAnmkadlKoWXNfkN5qm/oKg7D0fJi4pfPStth+3EGDkN5zIXvHZkI3lOzL YCzfWnuSqLCYvy4s+htDd4Cy/QrMaMkGHF90BfwRU9etYdO5YmgEU0K1MnEkiIIs oFh2JvCPe3xyAHI9ycH43y6LEPqwN7v27T4qsoIrrNFBaLCxBl0BPLmJYG8HQMuZ l4gObdryzSyxtRhAkFbbuDj8NRAB+VD8+wxX1taGJwbMTfdzSMXuEHj+cqoLYOj7 +wBhk6bRXiilsU00X9WMA9XuGc71nkgwPeEpFMsVljySgT5SWWq4cZpahDHAK/+I T1feSIEpwrhbDVtMt6FEy7Edf0q3Eoh+rYYVpY3zInwKwX/eJHSbbjMNP0lPrqtN At04Ywdaiw3tNRuD3wqn6WcVJLrxT1U28sogjnaK/XOUNV2CkLB18dhC0gurzUMe xyKrQXXQYVRnNtPXDnEaxGY0nbQa4XltCg1a/Z2oCYlBDU/QxhvpA1m7PN1i95dB MjWtTBIwlyT+RkoRoqA6ctUA2INwxKCBRQ1z61Piuty2AZzv15h1DSTqmhdXz61X GsQHmkNkyyogftG7GEy1PPqwiD1xSBMmp7GwQMZNimevK9iPFSW472dJGFyHf8EJ CxI3B21uR2Kw3tbaXND6OH9O9n7gXZS7VxnKNKfQihEuDaLokKg= =W7we -----END PGP SIGNATURE----- --pv/EksRKKho1AJAU--