Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37845180
en ru br
ALT Linux repos
S:3.14-alt2

Group :: Monitoring
RPM: iperf3

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: iperf3-3.10-idle-tcp-DoS.patch
Download


Idle TCP connection hangs/DoSes the server
https://github.com/esnet/iperf/issues/788
diff -Nur iperf-3.10.old/src/iperf_server_api.c iperf-3.10/src/iperf_server_api.c
--- iperf-3.10.old/src/iperf_server_api.c	2021-05-27 02:13:00.000000000 +0400
+++ iperf-3.10/src/iperf_server_api.c	2021-10-31 15:15:36.761797841 +0400
@@ -130,6 +130,12 @@
             return -1;
         }
 
+	struct timeval timeout;
+	timeout.tv_sec = 5;
+	timeout.tv_usec = 0;
+	setsockopt (s, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout, sizeof(timeout));
+	setsockopt (s, SOL_SOCKET, SO_SNDTIMEO, (const char *)&timeout, sizeof(timeout));
+
         if (Nread(test->ctrl_sck, test->cookie, COOKIE_SIZE, Ptcp) < 0) {
             i_errno = IERECVCOOKIE;
             return -1;
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin