[PATCH net-next 02/11] tools: ynl-gen: generate nested array policies

Jacob Keller jacob.e.keller at intel.com
Sat Sep 6 00:19:33 UTC 2025



On 9/4/2025 3:01 PM, Asbjørn Sloth Tønnesen wrote:
> This patch adds support for NLA_POLICY_NESTED_ARRAY() policies.
> 
> Example spec (from future wireguard.yaml):
> -
>   name: wgpeer
>   attributes:
>     -
>       name: allowedips
>       type: indexed-array
>       sub-type: nest
>       nested-attributes: wgallowedip
> 
> yields NLA_POLICY_NESTED_ARRAY(wireguard_wgallowedip_nl_policy).
> 
> This doesn't change any currently generated code, as it isn't
> used in any specs currently used for generating code.
> 
> Signed-off-by: Asbjørn Sloth Tønnesen <ast at fiberby.net>
> ---

Is this keyed of off the sub-type? Does you mean that all the existing
uses of 'sub-type: nest' don't generate code today? Or that this
_attr_policy implementation is not called yet?

I checked and we have quite a number of uses:

> $ rg 'sub-type: nest'
> Documentation/netlink/specs/nlctrl.yaml
> 69:        sub-type: nest
> 74:        sub-type: nest
> 
> Documentation/netlink/specs/tc.yaml
> 2045:        sub-type: nest
> 2065:        sub-type: nest
> 2190:        sub-type: nest
> 2304:        sub-type: nest
> 2494:        sub-type: nest
> 3021:        sub-type: nest
> 3181:        sub-type: nest
> 3567:        sub-type: nest
> 3799:        sub-type: nest
> 
> Documentation/netlink/specs/rt-link.yaml
> 2203:        sub-type: nest
> 
> Documentation/netlink/specs/nl80211.yaml
> 610:        sub-type: nest
> 1309:        sub-type: nest
> 1314:        sub-type: nest
> 1337:        sub-type: nest
> 1420:        sub-type: nest
> 1476:        sub-type: nest
> 1615:        sub-type: nest
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/wireguard/attachments/20250905/1df49cc6/attachment.sig>


More information about the WireGuard mailing list