[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231218142209.64b0a2ab@kernel.org>
Date: Mon, 18 Dec 2023 14:22:09 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 1/3] tools: ynl-gen: use correct len for string
and binary
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?
Powered by blists - more mailing lists