From bc342fe1074fe300065eb96046854fe3f3d9e648 Mon Sep 17 00:00:00 2001 From: eaglegai Date: Fri, 6 May 2022 10:20:53 +0800 Subject: [PATCH] fix exit code on -w option when count*interval > timeout --- arping-Fix-exit-code-on-w-option.patch | 24 ++++++++++++++++++++++++ iputils.spec | 10 +++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 arping-Fix-exit-code-on-w-option.patch diff --git a/arping-Fix-exit-code-on-w-option.patch b/arping-Fix-exit-code-on-w-option.patch new file mode 100644 index 0000000..e94d30f --- /dev/null +++ b/arping-Fix-exit-code-on-w-option.patch @@ -0,0 +1,24 @@ +From 4c2dd9f020df2749bdff294756b04aafa99ad624 Mon Sep 17 00:00:00 2001 +From: eaglegai +Date: Fri, 18 Mar 2022 19:32:21 +0800 +Subject: [PATCH] arping: Fix exit code on -w option when count * interval > + timeout + +Signed-off-by: eaglegai +--- + arping.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arping.c b/arping.c +index 20b0554b..fe79d2f8 100644 +--- a/arping.c ++++ b/arping.c +@@ -850,7 +850,7 @@ static int event_loop(struct run_state *ctl) + else if (ctl->dad && ctl->quit_on_reply) + /* Duplicate address detection mode return value */ + rc |= !(ctl->brd_sent != ctl->received); +- else if (ctl->timeout && !(ctl->count > 0)) ++ else if (ctl->timeout && (!(ctl->count > 0) || (ctl->interval > ctl->timeout / ctl->count))) + rc |= !(ctl->received > 0); + else + rc |= (ctl->sent != ctl->received); diff --git a/iputils.spec b/iputils.spec index 1c80f8c..962460c 100644 --- a/iputils.spec +++ b/iputils.spec @@ -1,6 +1,6 @@ Name: iputils Version: 20210722 -Release: 5 +Release: 6 Summary: Network monitoring tools including ping License: BSD and GPLv2+ URL: https://github.com/iputils/iputils @@ -23,6 +23,8 @@ Patch0007: backport-fix-ARP-protocol-field-for-AX.25-and-NETROM.patch Patch0008: backport-ping-Fix-ping6-binding-to-VRF-and-address.patch Patch0009: backport-ping6-Avoid-binding-to-non-VRF.patch +Patch0010: arping-Fix-exit-code-on-w-option.patch + BuildRequires: gcc meson libidn2-devel openssl-devel libcap-devel libxslt BuildRequires: docbook5-style-xsl systemd iproute glibc-kernheaders gettext %{?systemd_ordering} @@ -120,6 +122,12 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ %{_unitdir}/ninfod.service %changelog +* Fri May 06 2022 eaglegai - 20210722-6 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix exit code on -w option when count*interval > timeout + * Tue Apr 26 2022 zengweifeng - 20210722-5 - Type:bugfix - ID:NA