From 4db1de672559804bebcb7073d231924339ca8cd8 Mon Sep 17 00:00:00 2001 From: Petr Vorel Date: Wed, 22 May 2024 07:05:14 +0200 Subject: [PATCH] arping: Fix 1s delay on exit for unsolicited arpings Commit 67e070d introduced 1s poll() delay for unsolicited arpings, when using -U or -A, e.g.: # arping -A -c1 -I eth0 [IP address of eth0 interface] # arping -U -c1 -I eth0 [IP address of eth0 interface] Restore correct condition. Fixes: 67e070d ("arping: use signalfd() and timerfd() rather than signals") Fixes: https://github.com/iputils/iputils/issues/536 Closes: https://github.com/iputils/iputils/pull/541 Reported-by: Suggested-by: Signed-off-by: Petr Vorel --- arping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arping.c b/arping.c index 47066a96..c806999a 100644 --- a/arping.c +++ b/arping.c @@ -776,7 +776,7 @@ static int event_loop(struct run_state *ctl) pfds[POLLFD_SOCKET].events = POLLIN | POLLERR | POLLHUP; send_pack(ctl); - while (!exit_loop) { + while (!(exit_loop || ctl->unsolicited)) { int ret; size_t i;