From fba7048b08550d352f3a943439886ad92bccdbe6 Mon Sep 17 00:00:00 2001 From: eaglegai Date: Sat, 7 May 2022 10:24:30 +0800 Subject: [PATCH] fix exit code on -w option when count*interval > timeout --- arping-Fix-exit-code-on-w-option.patch | 24 ++++++++++++++++++++++++ iputils.spec | 9 ++++++++- 2 files changed, 32 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 efdcc35..499a5f4 100644 --- a/iputils.spec +++ b/iputils.spec @@ -1,6 +1,6 @@ Name: iputils Version: 20210722 -Release: 3 +Release: 4 Summary: Network monitoring tools including ping License: BSD and GPLv2+ URL: https://github.com/iputils/iputils @@ -19,6 +19,7 @@ Patch0003: backport-arping-fix-typo-in-error-checking.patch Patch0004: backport-fix-ARP-protocol-field-for-AX.25-and-NETROM.patch Patch0005: backport-ping-Fix-ping6-binding-to-VRF-and-address.patch Patch0006: backport-ping6-Avoid-binding-to-non-VRF.patch +Patch0007: 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 @@ -117,6 +118,12 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ %{_unitdir}/ninfod.service %changelog +* Fri May 06 2022 eaglegai - 20210722-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix exit code on -w option when count*interval > timeout + * Tue Apr 26 2022 zengweifeng - 20210722-3 - Type:bugfix - ID:NA