iputils/0002-ping-Make-ping_rts-struct-static.patch
Petr Vorel 3c01d125de Accepting request 1007675 from home:pevik:branches:network:utilities
- Backport 2 fixes for bsc#1203957:
  0001-ping-Add-SA_RESTART-to-sa_flags.patch
  0002-ping-Make-ping_rts-struct-static.patch

OBS-URL: https://build.opensuse.org/request/show/1007675
OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=102
2022-10-03 11:54:24 +00:00

39 lines
1.3 KiB
Diff

From eb6fb669f64aa3af2baf0e5cef5d46793fc97129 Mon Sep 17 00:00:00 2001
From: Petr Vorel <pvorel@suse.cz>
Date: Tue, 20 Sep 2022 22:23:44 +0200
Subject: [PATCH 2/2] 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>
[ upstream status: https://github.com/iputils/iputils/commit/7861af993bf47fccaf37c5659d66c09832844ae3 ]
---
ping/ping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ping/ping.c b/ping/ping.c
index 7a27b63..176410a 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -267,7 +267,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.37.3