summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-09-24 15:32:45 -0700
committerJakub Kicinski <kuba@kernel.org>2026-09-28 18:12:06 -0700
commitc20d84c6dec8236afecf6493b5b89d955dc83fc3 (patch)
treed825aab70587aa1d8a162fb0387caf8c04ecf6ce /tools/lib/python
parentbd8e2c16f184157aca31b8b6f8ee82055c44ee05 (diff)
tools: ynl-gen-c: keep the type values of a nest in spec order
Family._load_nested_set_nest() collects the type-value names of a nest-type-value attribute into a set and Struct.set_inherited() renders them sorted, while TypeNestTypeValue._attr_get() passes them to the parse helper in the order the spec lists them. For nlctrl's type-value: [policy-id, attr-id] that makes the generated helper take (attr_id, policy_id) and the caller pass (policy_id, attr_id). Both are __u32 so nothing complains, and every C YNL user of the nlctrl policy dump gets the two swapped. Two attributes nesting the same attribute set with the type values in a different order now fail set_inherited() instead of comparing equal. No spec does that today, but better safe than sorry. Nesting an attribute set which is also used as a sub-message gets its own check: it used to be caught by the list-versus-set type mismatch, which the ordering fix removes, and without it the generator emits a call to the sub-message parser with the selector argument missing. Again, no spec does this today. nlctrl is the only spec affected, discovered by an LLM scan of the spec. Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Link: https://patch.msgid.link/20260924223245.530132-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions