From 5237bbb85911df1776cd1fa7e5b2c106630c8260 Mon Sep 17 00:00:00 2001 From: xuxinyu Date: Fri, 6 Jan 2023 17:41:07 +0800 Subject: [PATCH] Handle NIC names longer than 7 characters. Signed-off-by: xuxinyu --- ...e-NIC-names-longer-than-7-characters.patch | 36 +++++++++++++++++++ fcoe-utils.spec | 6 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 backport-Handle-NIC-names-longer-than-7-characters.patch diff --git a/backport-Handle-NIC-names-longer-than-7-characters.patch b/backport-Handle-NIC-names-longer-than-7-characters.patch new file mode 100644 index 0000000..2a5dcb7 --- /dev/null +++ b/backport-Handle-NIC-names-longer-than-7-characters.patch @@ -0,0 +1,36 @@ +From e2392944cc779b2305bdbb7e6b9d9bb57d5398ee Mon Sep 17 00:00:00 2001 +From: Lee Duncan +Date: Tue, 9 Jun 2020 11:22:50 -0700 +Subject: [PATCH] Handle NIC names longer than 7 characters. + +The output of "fcoeadm -s" assumed a short NIC name, +so handle up to 15 characters, the current standard. +--- + fcoeadm_display.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fcoeadm_display.c b/fcoeadm_display.c +index f7e6c43806a..7d29422e91f 100644 +--- a/fcoeadm_display.c ++++ b/fcoeadm_display.c +@@ -455,7 +455,7 @@ static void scan_device_map(char *rport, enum disp_style style) + static void show_port_stats_header(const char *ifname, int interval) + { + printf("\n"); +- printf("%-7s interval: %-2d Err Inv " ++ printf("%-15s interval: %-2d Err Inv " + "IvTx Link Cntl Input Input Output Output\n", + ifname, interval); + printf("Seconds TxFrames TxBytes RxFrames RxBytes " +@@ -893,7 +893,7 @@ static void + print_interface_fcoe_lesb_stats_header(const char *ifname, int interval) + { + printf("\n"); +- printf("%-7s interval: %-2d\n", ifname, interval); ++ printf("%-15s interval: %-2d\n", ifname, interval); + printf("LinkFail VLinkFail MissFKA SymbErr ErrBlkCnt FCSErrCnt\n"); + printf("-------- --------- ------- ------- --------- ---------\n"); + } +-- +2.37.1.windows.1 + diff --git a/fcoe-utils.spec b/fcoe-utils.spec index 30fb409..9ca5a55 100644 --- a/fcoe-utils.spec +++ b/fcoe-utils.spec @@ -1,6 +1,6 @@ Name: fcoe-utils Version: 1.0.33 -Release: 3 +Release: 4 Summary: Fibre Channel over Ethernet utilities License: GPLv2 URL: https://github.com/morbidrsa/fcoe-utils @@ -12,6 +12,7 @@ Patch2: backport-02-string_op_truncation_format_trauncation.patch Patch3: backport-03-use-of-uninitialized-values-detected-during-LTO.patch #This patch refer to ubuntu's version Patch4: backport-Fix-build-error-to-change-char-type.patch +Patch5: backport-Handle-NIC-names-longer-than-7-characters.patch BuildRequires: autoconf automake libpciaccess-devel libtool lldpad-devel systemd Requires: lldpad iproute device-mapper-multipath @@ -67,6 +68,9 @@ done %{_mandir}/man8/* %changelog +* Fri Jan 06 2023 xuxinyu -1.0.33-4 +- Handle NIC names longer than 7 characters. + * Wed Mar 03 2022 xu_ping - 1.0.33-3 - Backport upstream patch to avoid non-X86 build break. -- Gitee