Skip to content

Commit

Permalink
tools: ynl-gen: don't override pure nested struct
Browse files Browse the repository at this point in the history
For pure structs (parsed nested attributes) we track what
forms of the struct exist in request and reply directions.
Make sure we don't overwrite the recorded struct each time,
otherwise the information is lost.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Jun 3, 2023
1 parent 6ad4983 commit 67c65ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/net/ynl/ynl-gen-c.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,8 @@ def _load_nested_sets(self):
inherit = set()
nested = spec['nested-attributes']
if nested not in self.root_sets:
self.pure_nested_structs[nested] = Struct(self, nested, inherited=inherit)
if nested not in self.pure_nested_structs:
self.pure_nested_structs[nested] = Struct(self, nested, inherited=inherit)
if attr in rs_members['request']:
self.pure_nested_structs[nested].request = True
if attr in rs_members['reply']:
Expand Down

0 comments on commit 67c65ce

Please sign in to comment.