Subject: Re: [PATCH net-next 1/3] tools: ynl-gen: use correct len for string and binary

From: Jakub Kicinski <[email-masked]>
Date: Mon, 18 Dec 2023 14:22:09 -0800

On Sat, 16 Dec 2023 16:35:40 +0800 Hangbin Liu wrote:
> The max-len / min-len / extact-len micro are used by binary. For string we
> need to use "len" to define the max length. e.g.
> 
> static const struct nla_policy
> team_nl_option_policy[TEAM_ATTR_OPTION_MAX + 1] = {
>         [TEAM_ATTR_OPTION_UNSPEC]               = { .type = NLA_UNSPEC, },
>         [TEAM_ATTR_OPTION_NAME] = {
>                 .type = NLA_STRING,
>                 .len = TEAM_STRING_MAX_LEN,
>         },

max-len / min-len / extact-len are just the names in the spec.
We can put the value provided in the spec as max-len inside
nla_policy as len, given that for string spec::max-len == policy::len 

Am I confused?