iputils/0002-arping-fix-sent-vs-received-packages-return-value.patch
Petr Šabata 58f51e4e71 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/iputils#d25aa1e7d92ec0d12fe7c7c37eaad82e34212f28
2020-10-15 13:45:04 +02:00

36 lines
1.1 KiB
Diff

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