aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2025-09-18 18:32:16 +0200
committerStefano Brivio <sbrivio@redhat.com>2025-09-19 19:30:00 +0200
commitad4aae7a3262460137c9a287819ee2957e882581 (patch)
tree23fcd238900f889422b44026fcd04f5714836e1d
parent080f176ed13245f9c2999ee5bf76fa4ca56dc7d3 (diff)
downloadpasst-ad4aae7a3262460137c9a287819ee2957e882581.tar
passt-ad4aae7a3262460137c9a287819ee2957e882581.tar.gz
passt-ad4aae7a3262460137c9a287819ee2957e882581.tar.bz2
passt-ad4aae7a3262460137c9a287819ee2957e882581.tar.lz
passt-ad4aae7a3262460137c9a287819ee2957e882581.tar.xz
passt-ad4aae7a3262460137c9a287819ee2957e882581.tar.zst
passt-ad4aae7a3262460137c9a287819ee2957e882581.zip
netlink: Drop nexthop state flags from routes we duplicate
The kernel doesn't like those (EINVAL) on RTM_NEWROUTE, as they are flags representing states, not configuration. Link: https://github.com/containers/podman/discussions/27104 Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Paul Holzinger <pholzing@redhat.com>
-rw-r--r--netlink.c5
1 files changed, 5 insertions, 0 deletions
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 != RTM_NEWROUTE)
continue;
+ /* nexthop state flags don't apply to freshly created routes,
+ * and the kernel will refuse our route if they are set.
+ */
+ rtm->rtm_flags &= ~RTNH_COMPARE_MASK;
+
for (rta = RTM_RTA(rtm), na = RTM_PAYLOAD(nh); RTA_OK(rta, na);
rta = RTA_NEXT(rta, na)) {
/* RTA_OIF and RTA_MULTIPATH attributes carry the