public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Paul Holzinger <pholzing@redhat.com>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Subject: Re: [PATCH] netlink: Drop nexthop state flags from routes we duplicate
Date: Fri, 19 Sep 2025 11:54:40 +0200	[thread overview]
Message-ID: <7571fda7-db9b-4e31-8ff2-629a716b6d1d@redhat.com> (raw)
In-Reply-To: <20250918163350.1204452-1-sbrivio@redhat.com>


On 18/09/2025 18:33, Stefano Brivio wrote:
> 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: Paul Holzinger <pholzing@redhat.com>
> ---
>   netlink.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> 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

-- 
Paul Holzinger


      parent reply	other threads:[~2025-09-19  9:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 16:33 Stefano Brivio
2025-09-19  0:33 ` David Gibson
2025-09-19  9:54 ` Paul Holzinger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7571fda7-db9b-4e31-8ff2-629a716b6d1d@redhat.com \
    --to=pholzing@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).