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: <20240901084431.1639ff75@hermes.local>
Date: Sun, 1 Sep 2024 08:44:31 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Michael Guralnik <michaelgur@...dia.com>
Cc: <dsahern@...il.com>, <leonro@...dia.com>, <jgg@...dia.com>,
 <linux-rdma@...r.kernel.org>, <netdev@...r.kernel.org>, Chiara Meiohas
 <cmeiohas@...dia.com>
Subject: Re: [RFC iproute2-next 2/4] rdma: Add support for rdma monitor

On Sun, 1 Sep 2024 03:54:54 +0300
Michael Guralnik <michaelgur@...dia.com> wrote:


Suggest these minor changes.

> +static const char *event_type_to_str(uint8_t etype)
> +{
> +	static const char *const event_types_str[] = { "[REGISTER]",
> +						       "[UNREGISTER]",
> +						       "[NETDEV_ATTACH]",
> +						       "[NETDEV_DETACH]" };

Break array initialization into:

	static const char *const event_types_str[] = {
			"[REGISTER]",
			"[UNREGISTER]"

> +	if (etype < ARRAY_SIZE(event_types_str))
> +		return event_types_str[etype];
> +
> +	return "[UNKNOWN]";

Might be useful to use snprintf to static buffer and print the hex value
for unknown events.

> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ