diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2018-10-07 14:17:50 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2018-10-07 17:15:45 +0200 |
commit | 0dbe3d28f7e2716e568ef36c8fa4d3c0964239f0 (patch) | |
tree | bdb1f9cf8cedd434ddfa11126d10acccc8fe5569 /package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch | |
parent | 95e2da836688469924df07f0009a94098e9c75fa (diff) | |
download | upstream-0dbe3d28f7e2716e568ef36c8fa4d3c0964239f0.tar.gz upstream-0dbe3d28f7e2716e568ef36c8fa4d3c0964239f0.tar.bz2 upstream-0dbe3d28f7e2716e568ef36c8fa4d3c0964239f0.zip |
iperf: fix --daemon option
Support for -D got broken in the 2.0.11 release by the upstream commit
218d8c667944 ("first pass L2 mode w/UDP checks, v4 only"). After that
commit clients were still able to connect but no traffic was passed.
It was reported and is fixed now in the upstream git repository.
Backport two patches to fix this. The first one is just a requirement
for the later to apply. The second one is the real fix and it needed
only a small adjustment to apply without backporing the commit
10887b59c7e7 ("fix --txstart-time report messages").
Fixes: 7d15f96eaf76 ("iperf: bump to 2.0.12")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 87cd118794cc9375260ea213838e80ad5295e83c)
Diffstat (limited to 'package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch')
-rw-r--r-- | package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch b/package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch new file mode 100644 index 0000000000..a713e06b96 --- /dev/null +++ b/package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch @@ -0,0 +1,43 @@ +From 7c0ac64ebea38d0d9ff4d160db4d33bc087a3490 Mon Sep 17 00:00:00 2001 +From: Robert McMahon <rjmcmahon@rjmcmahon.com> +Date: Mon, 16 Jul 2018 17:51:29 -0700 +Subject: [PATCH] fix latent bug in signal handling, per POSIX calling exit() + in signal handler is not safe. Use _exit() instead. Also, detect the user + signal SIGINT for the case of server needing two invocations to stop server + threads. Note: the server threads still need some work from graceful + termination with a single ctrl-c + +--- + +--- a/compat/signal.c ++++ b/compat/signal.c +@@ -171,7 +171,7 @@ void sig_exit( int inSigno ) { + static int num = 0; + if ( num++ == 0 ) { + fflush( 0 ); +- exit( 0 ); ++ _exit(0); + } + } /* end sig_exit */ + +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -268,7 +268,7 @@ void Sig_Interupt( int inSigno ) { + // We try to not allow a single interrupt handled by multiple threads + // to completely kill the app so we save off the first thread ID + // then that is the only thread that can supply the next interrupt +- if ( thread_equalid( sThread, thread_zeroid() ) ) { ++ if ( (inSigno == SIGINT) && thread_equalid( sThread, thread_zeroid() ) ) { + sThread = thread_getid(); + } else if ( thread_equalid( sThread, thread_getid() ) ) { + sig_exit( inSigno ); +@@ -420,9 +420,3 @@ VOID ServiceStop() { + } + + #endif +- +- +- +- +- +- |