From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id C089C5A004F for ; Wed, 19 Jun 2024 03:56:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1718762199; bh=ARjSL513AEmfWaWYTPzftxImZZ19CrJM09UfA6yzlQA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kAg++2OW0OONAuOBZWRzahXU12yBEFN1sbFCcvRC77WWORK5s4G5bYrEj/KWuheb0 tQiJauKLZcBPLdWIZ9mA3Ut0AsAxXfP+Tq33RCR1iFiUljAallS7yeobqHT1RsvWqn y6fsj4yhf5WmFAPk8V0kKY97Zofi3jre3kO9RzQpya1VF4ES2UyDCVf3agDD7hGedH qt2u1Pnoa9zZmdtBXSho4dxsfKfQLTWS7d5QbOShGx4/bTSpPCa+LVkx37IZ6AG+TM Ozmbz0d1tGfCbZ8sgk9gD4GVPdzOUc3DcCDliB1xyMi6xm6IS7i7284510qA6a0nEE ZBYzysPCdRhsw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4W3mvC1rx6z4wqK; Wed, 19 Jun 2024 11:56:39 +1000 (AEST) Date: Wed, 19 Jun 2024 11:56:33 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] netlink: Ignore EHOSTUNREACH failures when duplicating routes Message-ID: References: <20240618115611.1798383-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5iOkvTAIETGx9K5g" Content-Disposition: inline In-Reply-To: <20240618115611.1798383-1-sbrivio@redhat.com> Message-ID-Hash: FYKQT5JVSN7CZGAAKENOFGZX3MTHXT7Q X-Message-ID-Hash: FYKQT5JVSN7CZGAAKENOFGZX3MTHXT7Q 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: 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: --5iOkvTAIETGx9K5g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 18, 2024 at 01:56:11PM +0200, Stefano Brivio wrote: > To implicitly resolve possible dependencies between routes as we > duplicate them into the target namespace, we go through a set of n > routes n times, and ignore EEXIST responses to netlink messages (we > already inserted the route) and ENETUNREACH (we didn't insert the > route yet, but we need to insert another one first). >=20 > Until now, we didn't ignore EHOSTUNREACH responses. However, > NetworkManager users with multiple non-subnet routes for the same > interface report that pasta exits with "no route to host" while > duplicating routes. >=20 > This happens because NetworkManager sets the 'noprefixroute' attribute > on addresses, meaning that the kernel won't create subnet routes > automatically depending on the prefix length of the address. We copy > this attribute as we copy the address into the target namespace, and > as a result, the kernel doesn't create subnet routes in the target > namespace either. >=20 > This means that the gateway for routes that are inserted later can be > unreachable at some points during the sequence of route duplication. > That is, we don't just have dependencies between regular routes, but > we can also have dependencies between regular routes and subnet > routes, as subnet routes are not automatically inserted in advance. Nice explanation, thank you. > Link: https://github.com/containers/podman/issues/22824 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > netlink.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/netlink.c b/netlink.c > index 4dbddb2..0be4ea3 100644 > --- a/netlink.c > +++ b/netlink.c > @@ -655,7 +655,8 @@ int nl_route_dup(int s_src, unsigned int ifi_src, > rc =3D nl_do(s_dst, nh, RTM_NEWROUTE, > (flags & ~NLM_F_DUMP_FILTERED) | NLM_F_CREATE, > nh->nlmsg_len); > - if (rc < 0 && rc !=3D -ENETUNREACH && rc !=3D -EEXIST) > + if (rc < 0 && rc !=3D -EEXIST && > + rc !=3D -ENETUNREACH && rc !=3D -EHOSTUNREACH) > return rc; > } > } --=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 --5iOkvTAIETGx9K5g Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZyOtAACgkQzQJF27ox 2GcBUw//TLKylkfEPpdZ9RsFHs00es8JeL8QQ4Z6hjLRPXL+Rdi0hAtBM2AsFhI2 NbZZpLu3sa2rVI1EhCVql8fJTmU2ZXm5pdEtWvn+xcy+4/cybkoJlewBU2fuG/V3 02MPassKMGjBmO3Ta/DxBSU8yDNu+erxn9W2Uy8+Gc1+uw9bVGSDa50Y5yY1I+Tj zWBS69HjHjEbDfP0jr2zPzu86B78d7w3RPu0NUbZTYg8abYoCOfb8WCRtsuVlVV9 TKltvPke+PKr7VWo0rqo66q4Wdo9uuM8BQirUMZWIYzr72UxHJ5TXC00bPpb9kmQ it4PgJmaCiTDV81TRwdVjsNBNkWhHF9h8bO5n4sVJvVuWXcbryMU/PR/s5inZR2Z CITn37tGrUZg1wrh+4muR448Vu810ypbFTC1FG+oH1VRc6TfBLq//RIkpB6hsjzW b55pbLrskUphCr+p9YSD7FKm8xEcvsW/IO6HLwVVKpsuiaXsdH1AGJKjMb3qkWQw yn1OqDRfscQm2HH8osh35nHOMMTPP7E1JcpFnBXDD9tQlD6p0Btz5C92xWLi7beF oLLww2Owv3GlyZWiBcDAFd93TU2O7+ZmrZl7PYf5FNuB0Sk4OO4NGwQxNH7EMpjS /x2YObtROLbAcevHNV7MWL0KjoZlhHEOiUsuLwupwwXhj8qRgrU= =YWsk -----END PGP SIGNATURE----- --5iOkvTAIETGx9K5g--