iputils/002-arping-Fix-1s-delay-on-exit-for-unsolicited-arpings.patch

41 lines
1.2 KiB
Diff
Raw Normal View History

From a1890739e9d5953897cec43c59d5fea922384d5b Mon Sep 17 00:00:00 2001
From: Petr Vorel <pvorel@suse.cz>
Date: Wed, 22 May 2024 07:05:14 +0200
Subject: [PATCH 1/2] 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: <Curtis Taylor cjebpub@gmail.com>
Suggested-by: <Curtis Taylor cjebpub@gmail.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
(cherry picked from commit 4db1de672559804bebcb7073d231924339ca8cd8)
---
arping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arping.c b/arping.c
index 53fdbb4..8929f8f 100644
--- a/arping.c
+++ b/arping.c
@@ -749,7 +749,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;
--
2.46.0