arping exits with error when should not (#1836607)

Resolves: #1836607
This commit is contained in:
Jan Synacek 2020-05-18 09:55:10 +02:00
parent 84948e9f8f
commit faa0be8f51
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 84ca65ca980315c73f929fed8b6f16bbd698c3a0 Mon Sep 17 00:00:00 2001
From: Sami Kerola <kerolasa@iki.fi>
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 <kerolasa@iki.fi>
---
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

View File

@ -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 <jsynacek@redhat.com> - 20190515-7
- arping exits with error when should not (#1836607)
* Mon Mar 2 2020 Jan Synáček <jsynacek@redhat.com> - 20190515-6
- Make ping unprivileged (#1699497)