Subject: Re: [PATCH net-next v3 2/7] net: nexthop: Add NHA_OP_FLAGS

From: Ido Schimmel <[email-masked]>
Date: Tue, 5 Mar 2024 10:39:47 +0200

On Mon, Mar 04, 2024 at 09:51:15PM +0100, Petr Machata wrote:
> @@ -2992,6 +2994,11 @@ static int nh_valid_get_del_req(const struct nlmsghdr *nlh,
>  		return -EINVAL;
>  	}
>  
> +	if (tb[NHA_OP_FLAGS])
> +		*op_flags = nla_get_u32(tb[NHA_OP_FLAGS]);
> +	else
> +		*op_flags = 0;
> +
>  	return 0;
>  }

[...]

> @@ -3151,6 +3161,11 @@ static int __nh_valid_dump_req(const struct nlmsghdr *nlh, struct nlattr **tb,
>  		return -EINVAL;
>  	}
>  
> +	if (tb[NHA_OP_FLAGS])
> +		filter->op_flags = nla_get_bitfield32(tb[NHA_OP_FLAGS]).value;

Shouldn't this be:

filter->op_flags = nla_get_u32(tb[NHA_OP_FLAGS]);

?

> +	else
> +		filter->op_flags = 0;
> +
>  	return 0;
>  }