batctl: ping: Skip sleep after last packet
PATCH 1/1 batctl: ping: Skip sleep after last packet
The -i option for ping is documented as interval between ping requests. But the sleep was also applied after all the requested pings already sent out. As result, the user had to wait additional time until the statistics for the (limited) ping test was printed.
Just skip the last sleep in case there will be no next ping packet to avoid this problem.
Reported-by Roman Le bg <[email protected]>
Signed-off-by Sven Eckelmann <[email protected]>
--- ping.c | 4 ++++ 1 file changed, 4 insertions(+)
ping.c +4 -0
@@ -282,6 +282,10 @@ static int ping(struct state *state, int argc, char **argv) } sleep: +/* skip last sleep in case no more packets will be sent out */ +if (loop_count ==0 ) +continue ; +if (loop_interval >0 )sleep (loop_interval);else if ((tv.tv_sec !=0 ) || (tv.tv_usec !=0 ))
Signature · 1 line
2.30.2