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=202508 header.b=sLr0AtYw; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id B98C25A068E for ; Fri, 19 Sep 2025 02:33:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1758241997; bh=3XWpIaCpBCry8JyOJi+U8xdFFn+JxtSHqFFhzklyQWE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sLr0AtYwf09iHRQoLSGTscjumpeqwksFtleTkkjOEWtxzW0Q/9axZ0xadM3UWcQT1 UmlD4ujcAHp4EmIjnGo9KDz9S7g+KwDytoDBCEWN/nQSnKE7JyT3KO4Q9cUdt4qSWw rIVHCJppgg9/Gvm0iNXKUHnkkHM4dL+2V3g08Gc8jpE8FGDexbsdrwm7IAy/bzRVbe /kDat5f5QyC+KZM9x2P6cpVNlZQSMwbXQzRRmr6HK0XentNCxLQ+QZgKNIifAS8uZX V1fNH3LXXGx/Sxobyonjvlmm5hXffaKiR2Aw758uZN1AIr3uDDZbm3If7f9U7Ub+2b jpN7D+D+/sO2g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cSYQ54J8kz4wCS; Fri, 19 Sep 2025 10:33:17 +1000 (AEST) Date: Fri, 19 Sep 2025 10:33:08 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] netlink: Drop nexthop state flags from routes we duplicate Message-ID: References: <20250918163350.1204452-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bhJ13W8tGcahGEvr" Content-Disposition: inline In-Reply-To: <20250918163350.1204452-1-sbrivio@redhat.com> Message-ID-Hash: 534CHWEW6FXKV4UP27GZNEGN6GH6IBZV X-Message-ID-Hash: 534CHWEW6FXKV4UP27GZNEGN6GH6IBZV 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, Paul Holzinger 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: --bhJ13W8tGcahGEvr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 18, 2025 at 06:33:50PM +0200, Stefano Brivio wrote: > The kernel doesn't like those (EINVAL) on RTM_NEWROUTE, as they are > flags representing states, not configuration. >=20 > Link: https://github.com/containers/podman/discussions/27104 > Signed-off-by: Stefano Brivio Aha!, nice catch. Reviewed-by: David Gibson > --- > netlink.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/netlink.c b/netlink.c > index 8f82e73..c436780 100644 > --- a/netlink.c > +++ b/netlink.c > @@ -565,6 +565,11 @@ int nl_route_dup(int s_src, unsigned int ifi_src, > if (nh->nlmsg_type !=3D RTM_NEWROUTE) > continue; > =20 > + /* nexthop state flags don't apply to freshly created routes, > + * and the kernel will refuse our route if they are set. > + */ > + rtm->rtm_flags &=3D ~RTNH_COMPARE_MASK; > + > for (rta =3D RTM_RTA(rtm), na =3D RTM_PAYLOAD(nh); RTA_OK(rta, na); > rta =3D RTA_NEXT(rta, na)) { > /* RTA_OIF and RTA_MULTIPATH attributes carry the > --=20 > 2.43.0 >=20 --=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 --bhJ13W8tGcahGEvr Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjMpLYACgkQzQJF27ox 2Ger/RAAiNn1SOf/azpdNuviBIe/xf383drpjAcAir+kTWm0KCQdFBzG7TIoyRbG FWQRU9W27X53Ptgt0MtvjmvJPD2ZfYRKhLEcdD+/9HAEVZWq0WNnmsO/CwLn3SxB b8gTFJiN0VLofjEUdjsXfNBIgY6Loh4nYnq1fz3nGBf+no7XrTDHJZ53BknLyCt3 Pwhx8Z+YbPJkKSsFPb3p2Z0DVMJAOdb6IHX49nSnxhdxHHkEROYbajtaSbUzf6yH brfKuMw7fR1+RsP3EI+MpQBdHthUqNLRV8YbO6xkWGAti4KWPUo4v+7+4ezBH4tb xQJaTK8a6MHE907O2LMgWH5XLcDo1Q/hIfXQTMnJ3KzVKr1RuL/fpLZQLwEEgHwE nX3KwAOKVFG//5UxT6NpBdP61eGbTxAXWkBEHABWCLESGg+h5Coo6mdz4xllAnzP ZfAbCjVsVtpEA9OZuyLJXmlPMjs3YFNtf0ZUw6FtH5PfV1XtuwwRPl/XodnxdN4a dFEu1GVKGMzGiAqrCd9TAkQ2HxWeU4UC1fVGexPyXsJWoC7i/++ysKA9DdDpdqLm ssfOkmMfCpqv4HeCCK4lo6ekMkmz/6Pcd/2E1cF9x0xJaAEtW4UM8IPhXKyQbjhM fj5VGJEqfRV/llE/QT/s5Y4ww2jN6Xy9fVYzXLuhwXzd0eGRNbk= =hqPf -----END PGP SIGNATURE----- --bhJ13W8tGcahGEvr--