From 8978ab5ada59bdee5d08544f02b81c562d2d638a Mon Sep 17 00:00:00 2001 From: eaglegai Date: Mon, 19 Dec 2022 06:29:18 +0000 Subject: [PATCH] fix ifconfig display error when the length of interface name is 15 (cherry picked from commit c5e9be42e02d9fd08a94c4b170a6927aaa414bbd) --- ...n-the-length-of-interface-name-is-15.patch | 28 +++++++++++++++++++ net-tools.spec | 10 ++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 fix-ifconfig-display-error-when-the-length-of-interface-name-is-15.patch diff --git a/fix-ifconfig-display-error-when-the-length-of-interface-name-is-15.patch b/fix-ifconfig-display-error-when-the-length-of-interface-name-is-15.patch new file mode 100644 index 0000000..59c3d43 --- /dev/null +++ b/fix-ifconfig-display-error-when-the-length-of-interface-name-is-15.patch @@ -0,0 +1,28 @@ +From bf7cc74cd048bfd9d1fb9474e94a915cc9e86fdb Mon Sep 17 00:00:00 2001 +From: eaglegai +Date: Fri, 2 Dec 2022 09:47:06 +0800 +Subject: [PATCH] fix ifconfig display error when the length of interface name is 15 + +Signed-off-by: eaglegai +--- + lib/interface.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/interface.c b/lib/interface.c +index baa9a9a..f321340 100644 +--- a/lib/interface.c ++++ b/lib/interface.c +@@ -248,8 +248,10 @@ static const char *get_name(char **namep, const char *p) + } + *name++ = *p++; + count++; +- if (count == (IFNAMSIZ-1)) ++ if (count == (IFNAMSIZ-1)) { ++ p++; + break; ++ } + } + *name++ = '\0'; + return p; +-- +2.33.0 diff --git a/net-tools.spec b/net-tools.spec index 1543571..789212a 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -1,6 +1,6 @@ Name: net-tools Version: 2.10 -Release: 2 +Release: 3 Summary: Important Programs for Networking License: GPLv2+ URL: https://sourceforge.net/projects/net-tools/ @@ -19,6 +19,7 @@ Patch1: backport-net-tools-cycle.patch Patch2: backport-net-tools-man.patch Patch3: backport-ether-wake-interfaces.patch Patch4: backport-interface-change-pointopoint-short-flag-from-P-to-p.patch +Patch5: fix-ifconfig-display-error-when-the-length-of-interface-name-is-15.patch BuildRequires: bluez-libs-devel gettext, libselinux libselinux-devel systemd gcc %{?systemd_requires} @@ -45,6 +46,7 @@ cp %SOURCE8 ./man/en_US %patch2 -p1 -b .man %patch3 -p1 -b .interfaces %patch4 -p1 +%patch5 -p1 touch ./config.h %build @@ -105,6 +107,12 @@ touch %{buildroot}%{_unitdir}/arp-ethers.service %exclude %{_mandir}/pt/man5 %changelog +* Mon Dec 19 2022 eaglegai - 2.10-3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix ifconfig display error when the length of interface name is 15 + * Thu Oct 20 2022 konglidong - 2.10-2 - Type:bugfix - ID:NA -- Gitee