From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 1C1055A026D for ; Wed, 20 Mar 2024 13:49:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1710938991; bh=iIOn4S5WkoDH1RPJvtxmJZznhAerYGeCvhLRO0Ik6EQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Bi3yZHuoaJQzf+WmRWdGEsqdXRNuq7Wglkgu4+/aZrPEh1greaSt2O43Kx+GcWgKo RrdBz7u7ldbpRT4Bok8+iYuvWbyaxgRGht9g+qQC3uATyAlysTRLXW/XK+EHm48f9q SoyLbb0x80U+Yv7G7my+ULixWYI5rWAhEIn+g79/QDRrv6efkz4ZkZA2URyW4dIHuD /4R8w4cJVKzD4XXHr5w7cuZTP0tOV1ZUdWCimQbjEMcpJ7Y1Bkm5QFNHQWLyXslUA2 tc6Y3P8qUdkml3UhPdmAiPi7mVq9wkhpOtsMyN5TB9HzGZBQH/O1hJYYY6OULCSBKJ de+JGzYgS/peA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4V07hv70Ztz4wck; Wed, 20 Mar 2024 23:49:51 +1100 (AEDT) Date: Wed, 20 Mar 2024 23:49:47 +1100 From: David Gibson To: Paul Holzinger Subject: Re: [PATCH] netlink: Fix selection of template interface Message-ID: References: <20240320053339.553418-1-david@gibson.dropbear.id.au> <80107179-5357-4b14-94ae-c82925a97ba8@redhat.com> <20240320120243.49516b90@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LVvaRRJAFZ+Htl4X" Content-Disposition: inline In-Reply-To: Message-ID-Hash: AM4UVX7IBTLC7Z6ECGPWAVHEFBMVDY7G X-Message-ID-Hash: AM4UVX7IBTLC7Z6ECGPWAVHEFBMVDY7G 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 , 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: --LVvaRRJAFZ+Htl4X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 20, 2024 at 12:34:54PM +0100, Paul Holzinger wrote: >=20 > On 20/03/2024 12:02, Stefano Brivio wrote: > > On Wed, 20 Mar 2024 11:51:59 +0100 > > Paul Holzinger wrote: [snip] > > > > + if (anyifi) { > > > > + if (nany =3D=3D 1) > > > > + return anyifi; > > > > + > > > > + warn("Multiple interfaces with %s routes, use -i to select one", > > > > + af =3D=3D AF_INET ? "IPv4" : "IPv6"); > > > This should not be a warning, for me this always triggers because I h= ave > > > two interfaces with link local addresses and no global ipv6 route as I > > > do not have any ipv6 connection. > > I was about to reply as I just applied this with s/warn/info/ here :) > The more I think about this I think this suggestion is just wrong. I have= a > valid ipv4 connection and no ipv6, offering me to use -i is just wrong as= it > will not help me, especially if one uses a different interface for ipv4/i= pv6 > connections. Yeah, I think you're right. We should ignore link-local routes when doin this scan. Both for IPv6 and IPv4, although IPv4 link-local is much rarer. I'll have a look at that tomorrow, in the meantime this is still better than what we had. > > > Or maybe the correct fix is to never consider ipv6 link local routes = for > > > this logic? At least I cannot see the purpose of using a interface wi= th > > > only a link local route. > > >=20 > > > > + } > > > > + > > > > + if (!nany) > > > > + warn("No interfaces with %s routes", af =3D=3D AF_INET ? "IPv4" = : "IPv6"); > > ...and here, because if one has no IPv6 routes we would reintroduce the > > issue we just fixed in 338b6321ac0d ("conf: No routable interface for > > IPv4 or IPv6 is informational, not a warning"). > >=20 > > I think the purpose of picking interfaces based on routes for > > link-local destinations is for practical test setups like the one > > described in https://github.com/containers/podman/issues/21896. > >=20 > > Functionally it doesn't make sense, but it shouldn't harm either > > (right?). >=20 > I am not sure how the issue is related to link local addresses, for ipv6 a > link local route must explicitly never be routed anywhere else besides the > current interface so picking this seems incorrect as it will be unusable = not > matter what. >=20 > >=20 > > > > + > > > > + return 0; > > > > } > > > > /** > > > I reproduced by having a second interface and confirm this patch fixe= s it. > > Thanks for checking! Let's hope that was the case in the failing test. > >=20 >=20 --=20 David Gibson | 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 --LVvaRRJAFZ+Htl4X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmX622UACgkQzQJF27ox 2GdQ9A/9H74AI1e/tIAkQPIxj/qR5H31d1fn2/VE4QOfGipP68Rlmvy2gehmnEsp iLrDjJTB6MxwMcexMw98giCwOgoH2tPVi3BWAPytR/U5WzL0h7C8WgFV3twE/NyX 4Op7VOyxR64TzyCOuO2vt8lwwRTp0pVXpQ4+zR+eThdrjJmeeiLy265wmDInJNNl z8SmnJd4KnHOu0KEcFGI7rVDUR3bR0+H48HTlVcbe3hXuvPGjjUhttxu2ks7pQkn bIHQbHB9d5BjV6+dur55HUJUbLj5vDuhdDD6GU4NOf14fN603wB1F1YnZdGM/TMQ C4Gym5AgMz/MOtaF6UcRdek4K1AD5bof2ObskMhMkPYmP6DxbZJlfNKfKpGpzg/r s3NFSetCnIU3F2hOXmAZLZjddfiXq71Nl5zMYAiNgyxBz/ab6A1lNAoMJblYPKEG ib3ITCInFhkielIlGhZ833qjm+H3Ewlzo6qvhrQNiHK2dttFCPygXPsR8KdAdEuy DGLsm6VrXm5CVB0GyGkSFZ4sbQXKilRZ4b+4TG66euhc8eM2YeexN49gU71/Dibl j3UwdBE9OBWb/Ubhs3CDD+GsLXscsBRC2zHL1yEB6RqIxTXm2mK7ZHcApDqJGask sE243xvSY9RdQvXXYSiEnwm1mG8GAU2oQv+gbEZKjoaMmAo3Z6Q= =Xt8J -----END PGP SIGNATURE----- --LVvaRRJAFZ+Htl4X--