* Add NULL checks and comment
* Remove comment
* Change printf to iperf_err and add brackets to else
* Add test to iperf_err
* Revert iperf_err to printf
IPv6 link-local address literals are accepted in both places.
Note that we might not work correctly in the presumably rare case
of a FQDN that resolves to an IPv6 link-local address.
"%" is always treated as a separator for a shortcut to --bind-dev,
for IPv4 and IPv6 literals as well as hostnames passed to -c and -B.
The functions were added in f2c4e2b5bd and
implicitly declared in iperf_api.c, but were never actually declared in
the api header file! External users of the api need access to the
declaration in the header file to use the function from the library.
netdial() honors --bind-dev option but iperf_tcp_connect() doesn't,
as a result, only the control socket is bound to the device, but not
the data socket.
Instead of duplicaing code from netdial to iperf_tcp_connect(), this
fix extracts a common util function create_socket() from netdial() and
let iperf_tcp_connect() call create_socket() to create a socket with
optional bindings.
Tested on Raspberry Pi 3 with eth0 and wlan0.
* 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