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 <redacted>
---
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