diff --git a/arping.c b/arping.c index 346cb479..59a450ea 100644 --- a/arping.c +++ b/arping.c @@ -848,6 +848,8 @@ static int event_loop(struct run_state *ctl) else if (ctl->dad && ctl->quit_on_reply) /* Duplicate address detection mode return value */ rc |= !(ctl->brd_sent != ctl->received); + else if (ctl->timeout && !(ctl->count > 0)) + rc |= !(ctl->received > 0); else rc |= (ctl->sent != ctl->received); return rc; diff --git a/doc/arping.xml b/doc/arping.xml index 711718f2..9adbc0c2 100644 --- a/doc/arping.xml +++ b/doc/arping.xml @@ -202,13 +202,13 @@ xml:id="man.arping"> Specify a timeout, in seconds, before arping exits regardless of how many - packets have been sent or received. In this case - arping does not stop after - count packet are sent, it - waits either for - deadline expire or until - count probes are - answered. + packets have been sent or received. If any replies are + received, exit with status 0, otherwise status 1. When + combined with the count + option, exit with status 0 if count replies are received before the + deadline expiration, otherwise status 1. +