diff --git a/ethtool-fix-lanes-parameter-format.diff b/ethtool-fix-lanes-parameter-format.diff new file mode 100644 index 0000000..09f02b9 --- /dev/null +++ b/ethtool-fix-lanes-parameter-format.diff @@ -0,0 +1,41 @@ +From 4cbff6fb763fea892deafbe8a190387bc9d3dbad Mon Sep 17 00:00:00 2001 +From: Danielle Ratson +Date: Mon, 12 Aug 2024 17:11:11 +0300 +Subject: 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 +Reviewed-by: Amit Cohen +Reviewed-by: Ido Schimmel +--- + 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]); +-- +cgit 1.2.3-korg + diff --git a/ethtool.spec b/ethtool.spec index 2e3eaf6..576d22b 100644 --- a/ethtool.spec +++ b/ethtool.spec @@ -2,13 +2,14 @@ Summary: Settings tool for Ethernet NICs Name: ethtool Epoch: 2 Version: 6.10 -Release: 1%{?dist} +Release: 1.1%{?dist} # {json_print,qsfp,sff-common}.{c,h} are GPL-2.0-or-later, rest is GPL-2.0-only License: GPL-2.0-only AND GPL-2.0-or-later URL: https://www.kernel.org/pub/software/network/%{name}/ Source0: https://www.kernel.org/pub/software/network/%{name}/%{name}-%{version}.tar.xz Source1: https://www.kernel.org/pub/software/network/%{name}/%{name}-%{version}.tar.sign Source2: https://keys.openpgp.org/vks/v1/by-fingerprint/D2CB120AB45957B721CD9596F4554567B91DE934 +Patch0: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/patch/?id=4cbff6fb763fea892deafbe8a190387bc9d3dbad#/ethtool-fix-lanes-parameter-format.diff BuildRequires: gnupg2, xz BuildRequires: gcc BuildRequires: libmnl-devel @@ -22,7 +23,7 @@ network devices, especially of Ethernet devices. %prep xzcat '%{SOURCE0}' | %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data=- -%autosetup +%autosetup -p1 %build %configure @@ -44,6 +45,9 @@ make check %{_mandir}/man8/%{name}.8* %changelog +* Wed Aug 28 2024 Michel Lind - 2:6.10-1.1 +- Backport commit fixing lanes parameter format specifier + * Sat Aug 10 2024 Robert Scheck - 2:6.10-1 - Upgrade to 6.10 (#2303870)