39 lines
1.2 KiB
Diff
39 lines
1.2 KiB
Diff
From 68bdc8e127f1f02aa742b324d1cf3c89d251e13b Mon Sep 17 00:00:00 2001
|
|
From: Petr Vorel <pvorel@suse.cz>
|
|
Date: Tue, 20 Sep 2022 22:23:44 +0200
|
|
Subject: [PATCH] ping: Make ping_rts struct static
|
|
|
|
This allows accessing global_rts->exiting in sigexit() signal handler
|
|
after main() has exited. Problem occurred on aarch64, which occasionally
|
|
delivered signal after main() has exited, which causes segfault.
|
|
|
|
Fixes: b3a41a6 ("ping: move global variables to runtime config structure")
|
|
Fixes: https://github.com/iputils/iputils/issues/423
|
|
Closes: https://github.com/iputils/iputils/pull/425
|
|
|
|
Reported-by: linzhanglong
|
|
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
(cherry picked from commit 7861af993bf47fccaf37c5659d66c09832844ae3)
|
|
---
|
|
ping/ping.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/ping/ping.c b/ping/ping.c
|
|
index ff7e742..19913e6 100644
|
|
--- a/ping/ping.c
|
|
+++ b/ping/ping.c
|
|
@@ -263,7 +263,7 @@ main(int argc, char **argv)
|
|
socket_st sock6 = { .fd = -1 };
|
|
char *target;
|
|
char *outpack_fill = NULL;
|
|
- struct ping_rts rts = {
|
|
+ static struct ping_rts rts = {
|
|
.interval = 1000,
|
|
.preload = 1,
|
|
.lingertime = MAXWAIT * 1000,
|
|
--
|
|
2.49.0
|
|
|