* feat: Add a mechanism to disable checks for SCTP (--without-sctp).
The use case for this is building a static iperf3 binary on CentOS 7,
on a system with SCTP installed (but it has no static SCTP libraries).
In that case we need to disable SCTP detection to prevent a linking
error at runtime.
While here, s/iperf /iperf3 / in a couple of help strings.
This condition was only possible when configuration authentication
via the libiperf API.
While here, also fix a few other sundry issues:
* Remove arbitrary length limits on username and password.
* Improved error handling.
* Updated error messages for readability.
* Fixed minor typo in some identifiers.
Fixes#996.
This fixes a problem where UDP tests between systems with significant
clock skew would register large amounts of jitter at the start of the
test.
Fixes#842. Analysis done by (and solution inspired by) @davidBar-On.
This is a modified version of cJSON with support for 64-bit integers. This change pulls in some bug fixes and security fixes. It also fixes some compiler warnings on ILP32, caused by the way that we imported the previous cJSON (fixes inspired by #855).
Fix the following warning:
../../src/iperf_api.c: In function ‘iperf_on_connect’:
../../src/iperf_api.c:791:58: warning: format ‘%llu’ expects argument
of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
{aka ‘long unsigned int’} [-Wformat=]
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
the similar change also exist in the offical git:
https://github.com/DaveGamble/cJSON
Part of #935.
Change-Id: I3d98de3ec893ccf0b0cab37acc2dbfef00d9e2b6
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
(cherry picked from commit 98c868360c858f4c5fd466bd03fd157ac56b3f06)
Signed-off-by: Bruce A. Mah <bmah@es.net>
Part of #935.
Change-Id: Id702dee9d894d91420719928ae2de6b44b72f579
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
(cherry picked from commit 9dab732f5ec41be873cae3351b3d57fbfad36c93)
Signed-off-by: Bruce A. Mah <bmah@es.net>
by including arpa/inet.h, strings.h and sys/timer.h
Part of #935.
Change-Id: Ibac8d3a992457f2a7cc10f74b144e3ebe69976d8
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
(cherry picked from commit b9aa6cef43b338666a72bf6425fc88ed7602bce5)
Signed-off-by: Bruce A. Mah <bmah@es.net>
since not all platform define these signal number
Part of #935.
Change-Id: I98f14590ad45d1fe7e61076cce5a76b7874772ea
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
(cherry picked from commit d4267b66b5550c0e4cfec60439eab1d57a4a0c7a)
Signed-off-by: Bruce A. Mah <bmah@es.net>
Part of #935.
Change-Id: Ibcc4ad4370a6f99b030ca2c44f151c4550695957
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
(cherry picked from commit 6c10c3e6e65ffca32d97b3f2ef4db839c049a85c)
Signed-off-by: Bruce A. Mah <bmah@es.net>
Part of #935.
Change-Id: I5c563ad0cffce1a75b6a8039aa9a2e1543763880
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
(cherry picked from commit d7e30bea791e7bcd28eebf1ca6fe39e4f00ddc3c)
Signed-off-by: Bruce A. Mah <bmah@es.net>
When burst mode is configured for unlimited rate (-b0) but with a
specific packet burst value (e.g. /1000), iperf only sends packets once,
after that the iperf_check_throttle function gets called and sets
green_light=0 due to the rate value being 0 and average calculated rate
always being higher than 0.
The iperf_check_throttle function is designed to be skipped in case the
target rate is unlimited or if a specific burst value was configured,
however this skip is only utilized in one place where the function is
called leading to the situation above.
This can be fixed by moving the "skip throttling" condition directly
inside the iperf_check_throttle function.
Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
If --bidir option was passed before --client option on command line,
the latter would override ipt->mode parameter of the test back to SENDER
or RECEIVER making the test hang during execution.
Fix this by checking if ipt->bidirectional was set to true in
iperf_set_test_role() function.
The base64 decode will crash on musl c-library builds for OpenWRT
due to the write of the '\0' past the end of the allocated buffer.
Fix other various memory leaks on the authentication code paths.
Fix some memory-free library calls into OpenSSL.
Based heavily on PR #881 originally submitted by @acmay,
with comments from @ralcini.
The TEST_END message is racing with the server_timer_proc timer.
When the RTT is higher than a second, the timer wins the race
and closes the control socket before the results are exchanged.
This results in the client reporting:
"error - control socket has closed unexpectedly"
as reported in GH issue 751.
This change doesn't prevent the race, but significantly increases the
grace period based on a maximum RTT of 4 seconds and accounts for
the ten transitions in the iperf3 state machine.
(cherry picked from commit 34bdddb75194e880e6dbc6dcaa5b5386975c11b3)
(originally submitted by @acooks in #859)
To be able to set the test->outfile to a different file other than default
if using libiperf API.
Since logfile is now opened in iperf_parse_arguments() and this function
may not be used if running iperf using API, define a dedicated function
iperf_open_logfile() and move the opening of logfile into
iperf_run_client() and iperf_run_server() to make sure logfile will be
opened if iperf_parse_arguments() was not called.