* Draft release notes for iperf-3.10.
* iperf-3.10 version number bumps.
* Update using autoupdate-2.71 from Xcode 12 on macOS Big Sur.
* Regen.
* docs: Add release notes for recent changes.
tcp_info.snd_wnd is available on FreeBSD and NetBSD since TCP_INFO was
added. It was added to Linux 5.4 in late 2019 and becomes available
in Ubuntu 20.04 and Debian 11.
Tested on:
* Debian 11 running on x86-64 with this field.
* Debian 10 armv7 running on Raspberry Pi 2 without this field.
* NetBSD 9.2 armv7 running on Raspberry Pi 3 with this field.
* FreeBSD 13 aarch64 running on Raspberry Pi 4 with this field.
If the buffer happens to be holding exactly a sending chunk size,
we no longer arbitrarily quit.
While here, use equivalent, easier-to-read tests in a couple places.
Discussed with @hanvari
Follow-up to #1115.
Issue: `diskfile_send()` unconditional call to `sp->snd2`
would result in sending full buffer size everytime,
regardless of the file size.
Fix: The function updated to check for end-of-file (reading 0 bytes)
and,
1. set `sp->pending_size` to appropriate data length available to be sent
2. check for end condition and avoid sending data more than file size.
Note: The fix is only for the maximum cap on the data size sent on the network.
If other parameters (-t, -n, etc.) yield smaller size or shorter time then needed,
the file will still be partially sent to the network.
In theory this check should always succeed, given the relative
buffer sizes as currently coded.
Suggested by @grigorescu
Related to #1134.
(cherry picked from commit c3578291ca)
Signed-off-by: Bruce A. Mah <bmah@es.net>
This is a mostly-cosmetic reimplementation of pull request #1128.
Original commit log:
Fix two issues that caused an active TCP test to terminate if a new
connection request was received while in streams creation phase.
One issue was in iperf_tcp_accept() - after identifying that the cookies
of the new connection if from a new client, error was returned which
caused the active test to terminate. The other issue was in
iperf_run_server() where congestion alg was set for the new client,
although the stream to it was already closed by iperf_tcp_accept().
That also cause the active test to terminate.
Another minor issue that was fixed is that after a client received a
failure state (negative state) from the server, iperf_client_end()
still tried to send back IPERF_DONE to the server. That caused the
client to issue failure message of "unable to send control message:
Connection reset by peer" instead of "the server is busy running a test".
Originally submitted by: @davidBar-On
This prevents an "undefined socket" error, which can be incorrect if
the control connection didn't get opened due to a (for example)
"connection refused" type error.
This can be tested by running iperf3 in client mode and pointing it
towards a non-existent (or not-running) server.
Fixes#1129 (#1132 was an earlier, partial fix).
Enhancement to PR #1101 - add --rcv-timeout option to allow setting the timeout for receiving packet from the sender in a running test, instead of the constant 120 seconds set in #1101. This is to allow short timeout, so the server will not be "busy" for long time doing nothing. Also, the resolution is set to ms (with minimum of 100ms), as at least in fast networks that may be required.
Since both the server and the client can be a sender, the option is allowed for both. The server setting is for all tests - the client is not sending its --rcv-timeout setting to the server.
While changing the help message, few printf constants from other help lines were changed to parameters.
Adds an --dont-fragment flag that sets the DF flag in the header for UDP/IPv4 tests.
Co-authored-by: root <root@DESKTOP-L81E90U.localdomain>
Co-authored-by: Bruce A. Mah <bmah@es.net>
* fix: Correctly emit JSON for --server --json.
Put extra error diagnostic information behind --verbose, to avoid putting
extra "error" members in JSON output.
Fixes#1118.
`test->done` represents the test completion.
In some modes, duration-based (-t) test, and file-transfer (-F) in particular,
the `test->done` is set during the timeout handler or file-transfer functions.
For such configurations, and in general, `test->done` being set is sufficient
condition for terminating the test.
This commit generalizes the condition check to `test->done`,
removing the clause which limtis this condition case to duration-based test only.
In iperf_send() function, the check for termination test
in bytes/blocks mode is at the end of the iteration loop
for multisend (outer loop) and streams (inner loop).
If for any iteration of multisend (outer) loop bytes/blocks
sent reaches the desired limit, it still continues to send
data until the loop is exhausted. (The `break;` command does not
help, since it is already inside the streams (inner) loop).
This is a simple fix which brings the condition check to the
beginning of the inner loop, so it will skip the iteration if
the bytes/blocks count is already reached the target; hence
avoiding to send more data to the network.
For every new connection we saved the name of the congestion
control algorithm, but if there were multiple connections we'd
leak all but the last name.
Fixes#1100.
This lets iperf work better with multi-homed machines and
VRF.
Fixes#1089.
Based on a patch by Ben Greear <greearb@candelatech.com> via PR #817.
Co-authored-by: Ben Greear <greearb@candelatech.com>
We now only count an attempted send once all of its bytes are sent
(and will perform partial sends if necessary to finish sending all the bytes).
Previously, partial sends were counted as completed, for the purpose
of the -k option.
When the -b option specifies a burst value, throttling the bitrate does not work. This is because iperf_check_throttle() does not perform the check when burst value was defined.
This change removes the dependency of iperf_check_throttle() on the burst value and moves that check to the caller of that function. (Except for the call by send_timer_proc() which does not seem to be related to the change.)
Making sure the server closes prot_listener socket at the end of a session with a client. Without this change the socket may remain open, for example when there is a failure during the UDP stream establishment because the --window value is too high. Closing the socket was added to cleanup_server() as it seems to handle all cases where the socket may remain open.
* Issue 1065
* feat: Allow to configure a custom value for time drift between client/server for authentication
The use case is to support scenarios where it's not possible to enforce sync between client and server times.
* enh: drift redefined with skew
Co-authored-by: Francesco Marino <francesco.marino@cybaze.it>
The goal is to improve the responsiveness and/or reliability of
messages on the control connection, particularly in cases where the
test traffic fills up the path between client and server.
Originally suggested and implemented by @andrepuschmann, this version
adds some error-checking and a version for the client side as well as
the server.
Fixes#1045.
It didn't make anything crash, but API clients wouldn't be able to
access the JSON output.
Bug pointed out, and fix suggested by, @scottmsilver. Fixes#1058.
On a 32-bit PowerPC Linux system using musl libc (with 64-bit time_t),
the t_auth test fails because `long` is not the same type as `time_t`.
This patch uses an int64_t temporary value, which can be truncated to
32-bit if necessary.
* fix: Make --reverse tests with --blockcount or --bytes actually terminate.
Note that these options still don't really give intuitive results, because
the ending conditions are evaluated on the client, which then needs to
convey to the server via the control channel to stop sending. This
will almost never result in the desired outcome of "a test of exactly
N sends (or bytes) sent from the server to the client".
Also add test cases for --blockcount / --bytes with --reverse.
Towards #982.