summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2019-07-05 21:01:53 +0100
committerSami Kerola <kerolasa@iki.fi>2019-07-05 21:01:53 +0100
commit84ca65ca980315c73f929fed8b6f16bbd698c3a0 (patch)
tree69f77942fd574bf3582bf211e788c992e1c8e86b
parent368c345ff9a648ea28ece9725522f5363b869823 (diff)
downloadiputils-84ca65ca980315c73f929fed8b6f16bbd698c3a0.tar.gz
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>
-rw-r--r--arping.c2
1 files changed, 1 insertions, 1 deletions
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;
}