Re: [PATCH net-next 06/11] tools: ynl-gen: don't validate nested array attribute types
From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-09-06 00:23:35
Also in:
lkml
From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-09-06 00:23:35
Also in:
lkml
On Thu, 4 Sep 2025 22:01:29 +0000 Asbjørn Sloth Tønnesen wrote:
In nested arrays don't require that the intermediate attribute type should be a valid attribute type, it might just be an index or simple 0, it is often not even used. See include/net/netlink.h about NLA_NESTED_ARRAY:quoted
The difference to NLA_NESTED is the structure: NLA_NESTED has the nested attributes directly inside while an array has the nested attributes at another level down and the attribute types directly in the nesting don't matter.
I don't understand, please provide more details.
This is an ArrayNest, right?
[ARRAY-ATTR]
[ENTRY]
[MEMBER1]
[MEMBER2]
[ENTRY]
[MEMBER1]
[MEMBER2]
Which level are you saying doesn't matter?
If entry is a nest it must be a valid nest.
What the comment you're quoting is saying is that the nla_type of ENTRY
doesn't matter.