Skip to content

Commit 702aae3

Browse files
committed
ynl-gen-cpp: make sure requests get array local var
We add this for nested structs but not request structs. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 94bd965 commit 702aae3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ynl-gen-cpp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,11 @@ def print_req(ri):
22772277
if ri.fixed_hdr:
22782278
local_vars += ["size_t hdr_len;", "void *hdr;"]
22792279

2280+
for _, arg in ri.struct["request"].member_list():
2281+
if arg.type == "indexed-array":
2282+
local_vars.append("struct nlattr *array;")
2283+
break
2284+
22802285
print_prototype(ri, direction, terminate=False)
22812286
ri.cw.block_start()
22822287
ri.cw.write_func_lvar(local_vars)

0 commit comments

Comments
 (0)