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: <m2jziad9kj.fsf@gmail.com>
Date: Thu, 27 Jun 2024 10:22:20 +0100
From: Donald Hunter <donald.hunter@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net,  netdev@...r.kernel.org,  edumazet@...gle.com,
  pabeni@...hat.com,  jiri@...nulli.us
Subject: Re: [PATCH net-next] tools: ynl: use display hints for formatting
 of scalar attrs

Jakub Kicinski <kuba@...nel.org> writes:

> Use display hints for formatting scalar attrs. This is specifically
> useful for formatting IPv4 addresses carried typically as u32.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>

I don't know how scalars got missed out :shrug:

Reviewed-by: Donald Hunter <donald.hunter@...il.com>

Thanks!

> ---
> CC: donald.hunter@...il.com
> CC: jiri@...nulli.us
> ---
>  tools/net/ynl/lib/ynl.py | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
> index 35e666928119..d42c1d605969 100644
> --- a/tools/net/ynl/lib/ynl.py
> +++ b/tools/net/ynl/lib/ynl.py
> @@ -743,6 +743,8 @@ genl_family_name_to_id = None
>                  decoded = attr.as_scalar(attr_spec['type'], attr_spec.byte_order)
>                  if 'enum' in attr_spec:
>                      decoded = self._decode_enum(decoded, attr_spec)
> +                elif attr_spec.display_hint:
> +                    decoded = self._formatted_string(decoded, attr_spec.display_hint)
>              elif attr_spec["type"] == 'indexed-array':
>                  decoded = self._decode_array_attr(attr, attr_spec)
>              elif attr_spec["type"] == 'bitfield32':

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ