From faa0be8f510619c93d1af52e454490752cfbd809 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 18 May 2020 09:55:10 +0200 Subject: [PATCH] arping exits with error when should not (#1836607) Resolves: #1836607 --- ...nt-vs-received-packages-return-value.patch | 35 +++++++++++++++++++ iputils.spec | 6 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0002-arping-fix-sent-vs-received-packages-return-value.patch diff --git a/0002-arping-fix-sent-vs-received-packages-return-value.patch b/0002-arping-fix-sent-vs-received-packages-return-value.patch new file mode 100644 index 0000000..650cd8c --- /dev/null +++ b/0002-arping-fix-sent-vs-received-packages-return-value.patch @@ -0,0 +1,35 @@ +From 84ca65ca980315c73f929fed8b6f16bbd698c3a0 Mon Sep 17 00:00:00 2001 +From: Sami Kerola +Date: Fri, 5 Jul 2019 21:01:53 +0100 +Subject: arping: fix sent vs received packages return value + +My earlier signalfd() and timerfd() work really messed up sent vs received +package counter comparison, and related command return value. Basically +everything always mismatched, and that was expected with corner case of one +package only that did match and caused none-zero return. Oh my, that is +pretty much as wrong the code could have been. + +Reported-by: MarcusRoeckrath +Addresses: https://github.com/iputils/iputils/issues/190 +Broken-since: 67e070d08dcbec990e1178360f82b3e2ca4f6d5f +Signed-off-by: Sami Kerola +--- + arping.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arping.c b/arping.c +index a1ec231..77c9c56 100644 +--- a/arping.c ++++ b/arping.c +@@ -792,7 +792,7 @@ static int event_loop(struct run_state *ctl) + close(tfd); + freeifaddrs(ctl->ifa0); + rc |= finish(ctl); +- rc |= !(ctl->brd_sent != ctl->received); ++ rc |= (ctl->sent != ctl->received); + return rc; + } + +-- +2.26.2 + diff --git a/iputils.spec b/iputils.spec index bfaf15d..896d5db 100644 --- a/iputils.spec +++ b/iputils.spec @@ -3,7 +3,7 @@ Summary: Network monitoring tools including ping Name: iputils Version: 20190515 -Release: 6%{?dist} +Release: 7%{?dist} # some parts are under the original BSD (ping.c) # some are under GPLv2+ (tracepath.c) License: BSD and GPLv2+ @@ -18,6 +18,7 @@ Source4: bsd.txt Source5: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt Patch001: 0001-build-sys-doc-Fix-the-dependency-on-xsltproc.patch +Patch002: 0002-arping-fix-sent-vs-received-packages-return-value.patch Patch100: iputils-ifenslave.patch BuildRequires: gcc @@ -133,6 +134,9 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ %attr(644,root,root) %{_mandir}/man8/ninfod.8.gz %changelog +* Mon May 18 2020 Jan Synáček - 20190515-7 +- arping exits with error when should not (#1836607) + * Mon Mar 2 2020 Jan Synáček - 20190515-6 - Make ping unprivileged (#1699497)