Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, dsahern@kernel.org
Subject: Re: [RFC net-next 0/3] net: fix route flush for routes using nexthop objects
Date: Wed, 25 Nov 2026 15:09:08 +0200	[thread overview]
Message-ID: <20261125130908.GA187957@shredder> (raw)
In-Reply-To: <20261120200635.95798-1-stephen@networkplumber.org>

On Fri, Nov 20, 2026 at 12:01:27PM -0800, Stephen Hemminger wrote:
> "ip route flush" fails on any route that uses a nexthop object:
> 
>   # ip nexthop add id 101 via 192.0.2.1 dev dummy0
>   # ip route add 203.0.113.0/24 nhid 101
>   # ip route flush to 203.0.113.0/24
>   Failed to send flush request: Invalid argument
> 
> The first attempt at fixing that was to modify iproute but
> that is just working around a kernel bug. Flush should be
> able to be done as dump-and-echo by flipping to set
> RTM_DELROUTE. This always worked until nexthop compat mode
> was introduced.
> 
> This series fixes thes by changing where fib handling
> is done on delete. I don't use next hop id anywhere
> so this is just a proposal.

Comments on this approach were already given:

https://lore.kernel.org/netdev/20261118084510.332821-1-zypulsecore@gmail.com/

To reiterate, I disagree that this is a kernel bug and I am against
weakening the kernel's validation for the sole purpose of making "ip
route flush" work with nexthop objects in compat mode. This can be
easily fixed in iproute2. The current design is fragile and makes
assumptions that the kernel never guaranteed.

Also, Claude found another example that doesn't work with the current
design and predates nexthop objects:

# sysctl -wq net.mpls.platform_labels=1000
# ip link add name veth0 type veth peer name veth1
# ip link set dev veth0 up
# ip -f mpls route add 100 as 200 via inet 10.0.0.2 dev veth0
# ip -f mpls route flush table main
Failed to send flush request: Invalid argument

      parent reply	other threads:[~2026-11-25 13:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 20:01 [RFC net-next 0/3] net: fix route flush for routes using nexthop objects Stephen Hemminger
2026-11-20 20:01 ` [RFC next-net 1/3] net: accept legacy nexthop attributes when deleting by nexthop id Stephen Hemminger
2026-11-20 20:01 ` [RFC next-net 2/3] ipv4: accept the reported route type when deleting a blackhole nexthop route Stephen Hemminger
2026-11-20 20:01 ` [RFC next-net 3/3] selftests: fib_nexthops: test route flush with nexthop objects Stephen Hemminger
2026-11-25 13:09 ` Ido Schimmel [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=20261125130908.GA187957@shredder \
    --to=idosch@nvidia.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox