Re: [PATCH net 1/2] ipv4: accept nexthop dump attributes in route deletes
From: David Ahern
Date: Thu Nov 19 2026 - 10:47:40 EST
On 11/18/26 2:45 AM, Yuen Su wrote:
> diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
> index 8c123b1..6b012c8 100644
> --- a/net/ipv4/fib_frontend.c
> +++ b/net/ipv4/fib_frontend.c
> @@ -868,7 +868,10 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,
> goto errout;
> }
>
> - if (cfg->fc_nh_id) {
> + /* Dumps can include both a nexthop ID and compatibility attributes.
> + * On deletion, fib_nh_match() uses the ID to match the nexthop.
> + */
> + if (cfg->fc_nh_id && nlh->nlmsg_type != RTM_DELROUTE) {
> if (cfg->fc_oif || cfg->fc_gw_family ||
> cfg->fc_encap || cfg->fc_mp) {
> NL_SET_ERR_MSG(extack,
as the error message at this point shows, the 2 specifications must be
mutually exclusive. iproute2 will need to strip the nh_id or the nexthop
spec.