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: <c4e959f2-726d-4b00-a75b-c6625f5b5442@intel.com>
Date: Tue, 8 Apr 2025 21:57:32 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, <davem@...emloft.net>
CC: <netdev@...r.kernel.org>, <edumazet@...gle.com>, <pabeni@...hat.com>,
	<andrew+netdev@...n.ch>, <horms@...nel.org>, <donald.hunter@...il.com>,
	<yuyanghuang@...gle.com>, <sdf@...ichev.me>, <gnault@...hat.com>,
	<nicolas.dichtel@...nd.com>, <petrm@...dia.com>
Subject: Re: [PATCH net-next 08/13] tools: ynl-gen: don't consider requests
 with fixed hdr empty



On 4/8/2025 5:03 PM, Jakub Kicinski wrote:
> C codegen skips generating the structs if request/reply has no attrs.
> In such cases the request op takes no argument and return int
> (rather than response struct). In case of classic netlink a lot of
> information gets passed using the fixed struct, however, so adjust
> the logic to consider a request empty only if it has no attrs _and_
> no fixed struct.
> 
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
>  tools/net/ynl/pyynl/ynl_gen_c.py | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py
> index 9e00aac4801c..04f1ac62cb01 100755
> --- a/tools/net/ynl/pyynl/ynl_gen_c.py
> +++ b/tools/net/ynl/pyynl/ynl_gen_c.py
> @@ -1247,6 +1247,9 @@ from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, S
>          if op_mode == 'event':
>              self.struct['reply'] = Struct(family, self.attr_set, type_list=op['event']['attributes'])
>  
> +    def type_empty(self, key):
> +        return len(self.struct[key].attr_list) == 0 and self.fixed_hdr is None
> +
>  
Ahh.. I think I see where my mistake from earlier regarding the
attributes. classic netlink has a fixed struct + sometimes attributes.
We don't need to list struct members as part of attributes because the
header will always be there. Ok.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ