Re: [PATCH net 2/4] tools: ynl-gen: use macro for binary min-len check

Asbjørn Sloth Tønnesen <[email protected]>
Newsgroups com.zx2c4.lists.wireguard,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
Thank you for the quick reviews.

On 9/1/25 6:52 PM, Jakub Kicinski wrote:
> On Mon,  1 Sep 2025 14:50:21 +0000 Asbjørn Sloth Tønnesen wrote:
>> This patch changes the generated min-len check for binary
>> attributes to use the NLA_POLICY_MIN_LEN() macro, and thereby
>> ensures that .validation_type is not left at NLA_VALIDATE_NONE.
> 
> Please test this well and include the results in the commit message.
> I'm pretty sure it's fine as is.

You are right, because .type is unset, then .validation_type doesn't matter.

Sorry, I didn't do enough testing for the fixes, I had looked at the NLA_BINARY
case in validate_nla(), not NLA_UNSPEC.

Will re-post for net-next without fixes, and a new commit message.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.