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>] [day] [month] [year] [list]
Message-ID: <20240812141111.3718889-1-danieller@nvidia.com>
Date: Mon, 12 Aug 2024 17:11:11 +0300
From: Danielle Ratson <danieller@...dia.com>
To: <netdev@...r.kernel.org>
CC: <mkubecek@...e.cz>, <mlxsw@...dia.com>, Danielle Ratson
	<danieller@...dia.com>
Subject: [PATCH ethtool] netlink: settings: Fix lanes parameter format specifier

Lanes parameter is not printed well on ethtool base command causing the
following output:

$ ethtool swp1

[..]
        Speed: 400000Mb/s
Segmentation fault (core dumped)

Use the "%u" format specifier instead of "%s", since the lanes parameter
type is unsigned integer and not a string.

Fixes: bd1341cd2146 ("add json support for base command")
Signed-off-by: Danielle Ratson <danieller@...dia.com>
Reviewed-by: Amit Cohen <amcohen@...dia.com>
Reviewed-by: Ido Schimmel <idosch@...dia.com>
---
 netlink/settings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netlink/settings.c b/netlink/settings.c
index 9dd688b..62dd339 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -527,7 +527,7 @@ int linkmodes_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 		uint32_t val = mnl_attr_get_u32(tb[ETHTOOL_A_LINKMODES_LANES]);
 
 		print_banner(nlctx);
-		print_uint(PRINT_ANY, "lanes", "\tLanes: %s\n", val);
+		print_uint(PRINT_ANY, "lanes", "\tLanes: %u\n", val);
 	}
 	if (tb[ETHTOOL_A_LINKMODES_DUPLEX]) {
 		uint8_t val = mnl_attr_get_u8(tb[ETHTOOL_A_LINKMODES_DUPLEX]);
-- 
2.45.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ