lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1aaf9978-5bac-451e-8670-905809e7d1bf@intel.com>
Date: Fri, 5 Sep 2025 17:20:58 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Asbjørn Sloth Tønnesen <ast@...erby.net>, "Jason A.
 Donenfeld" <Jason@...c4.com>, "David S. Miller" <davem@...emloft.net>, "Eric
 Dumazet" <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>
CC: Donald Hunter <donald.hunter@...il.com>, Simon Horman <horms@...nel.org>,
	Andrew Lunn <andrew+netdev@...n.ch>, <wireguard@...ts.zx2c4.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 04/11] tools: ynl-gen: define count iterator in
 print_dump()



On 9/4/2025 3:01 PM, Asbjørn Sloth Tønnesen wrote:
> In wireguard_get_device_dump(), as generated by print_dump(),
> it didn't generate a declaration of `unsigned int i`:
> 
> $ make -C tools/net/ynl/generated wireguard-user.o
> -e      CC wireguard-user.o
> wireguard-user.c: In function ‘wireguard_get_device_dump’:
> wireguard-user.c:502:22: error: ‘i’ undeclared (first use in this fn)
>   502 |                 for (i = 0; i < req->_count.peers; i++)
>       |                      ^
> 
> Copy the logic from print_req() as it correctly generated the
> iterator in wireguard_set_device().
> 
> Signed-off-by: Asbjørn Sloth Tønnesen <ast@...erby.net>
> ---

Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>

>  tools/net/ynl/pyynl/ynl_gen_c.py | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py
> index 04c26ed92ca3..b0eeedfca2f2 100755
> --- a/tools/net/ynl/pyynl/ynl_gen_c.py
> +++ b/tools/net/ynl/pyynl/ynl_gen_c.py
> @@ -2425,6 +2425,11 @@ def print_dump(ri):
>          local_vars += ['size_t hdr_len;',
>                         'void *hdr;']
>  
> +    for _, attr in ri.struct['request'].member_list():
> +        if attr.presence_type() == 'count':
> +            local_vars += ['unsigned int i;']
> +            break
> +
>      ri.cw.write_func_lvar(local_vars)
>  
>      ri.cw.p('yds.yarg.ys = ys;')



Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ