iputils/0002-arping-fix-sent-vs-received-packages-return-value.patch
2020-05-18 09:55:28 +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