From b4d5d4c72644e68e441f48382869cac0e2d4d23c Mon Sep 17 00:00:00 2001 From: eaglegai Date: Mon, 19 Dec 2022 06:59:07 +0000 Subject: [PATCH] fix ifconfig display error when the length of interface name is 15 --- ...n-the-length-of-interface-name-is-15.patch | 28 +++++++++++++++++++ net-tools.spec | 11 +++++++- 2 files changed, 38 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 43ddc1d..0c1a382 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -1,6 +1,6 @@ Name: net-tools Version: 2.0 -Release: 0.55 +Release: 0.56 Summary: Important Programs for Networking License: GPLv2+ URL: https://sourceforge.net/projects/net-tools/ @@ -23,6 +23,7 @@ Patch21: net-tools-ifconfig-EiB.patch Patch22: net-tools-timer-man.patch Patch23: net-tools-interface-name-len.patch Patch24: backport-interface-change-pointopoint-short-flag-from-P-to-p.patch +Patch25: 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} @@ -53,6 +54,8 @@ cp %SOURCE8 ./man/en_US %patch22 -p1 -b .timer-man %patch23 -p1 -b .interface-name-len %patch24 -p1 +%patch25 -p1 + touch ./config.h %build @@ -113,6 +116,12 @@ touch %{buildroot}%{_unitdir}/arp-ethers.service %exclude %{_mandir}/pt/man5 %changelog +* Mon Dec 19 2022 eaglegai - 2.0-0.56 +- 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.0-0.55 - Type:bugfix - ID:NA