1
1
Граф коммитов

1171 Коммитов

Автор SHA1 Сообщение Дата
Bruce A. Mah
d8d827455d
Release engineering changes for iperf-3.10 (#1151)
* 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.
2021-05-26 15:03:59 -07:00
Bruce A. Mah
e479d607e1
chore: Regen. 2021-05-21 15:18:39 -07:00
Bruce A. Mah
318fbf2e62
chore: autoupdate 2021-05-21 15:18:01 -07:00
Shuo Chen
47985d7fc4 Add tcp_info.snd_wnd to JSON output.
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.
2021-05-21 15:16:08 -07:00
David Bar-On
2ec43d1261 Fix issue #1143 - make sure terminating error message is inside the JSON output 2021-05-20 15:03:59 -07:00
Bruce A. Mah
787919c4b3
fix: Handle a corner case more gracefully.
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.
2021-04-16 14:59:31 -07:00
Hamid Anvari
f4a114652f diskfile_send() sent data capped at file-size
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.
2021-04-16 14:55:02 -07:00
Bruce A. Mah
466f4c187f
Make sure we don't pass in a negative buffer size.
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>
2021-04-14 10:21:38 -07:00
Bruce A. Mah
6b266c79e6
enh: Move iperf_printf's buffer off the stack.
(cherry picked from commit 528cea5d54)
Signed-off-by: Bruce A. Mah <bmah@es.net>
2021-04-14 10:21:24 -07:00
Bruce A. Mah
9e2006e2f0
fix: Do a better job of counting bytes in iperf_printf.
Related to #1134.

(cherry picked from commit f9bc608957)
Signed-off-by: Bruce A. Mah <bmah@es.net>
2021-04-14 10:21:04 -07:00
Bruce A. Mah
35a3ed3fb0
fix: Fix a couple of buffer overrun hazards.
Pointed out by @berkakinci.

Fixes #1134.

(cherry picked from commit 9e244bb97f)
Signed-off-by: Bruce A. Mah <bmah@es.net>
2021-04-14 10:20:27 -07:00
Bruce A. Mah
c499087116
Merge pull request #1140 from esnet/revert-1137-issue-1134
Revert "fix: Fix a couple of buffer overrun hazards."
2021-04-14 10:17:17 -07:00
Bruce A. Mah
ac5fad17a9
Revert "fix: Fix a couple of buffer overrun hazards." 2021-04-14 10:16:34 -07:00
Bruce A. Mah
670a596f57
Merge pull request #1137 from esnet/issue-1134 2021-04-14 10:15:05 -07:00
Bruce A. Mah
1e33e72152
fix: Handle correctly some errors on initial client connect. (#1139)
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
2021-04-14 08:31:07 -07:00
Bruce A. Mah
50638f60ce
fix: Follow-up commit for #1138 to fix a couple misspellings.
No functional changes.
2021-04-13 14:22:30 -07:00
David Bar-On
27695dc4d7
enh: do not fail when new connection is refused during a running test (#1138)
Fixes #1135.
2021-04-13 14:19:00 -07:00
Bruce A. Mah
c3578291ca
Make sure we don't pass in a negative buffer size.
In theory this check should always succeed, given the relative
buffer sizes as currently coded.
2021-04-12 13:12:11 -07:00
Bruce A. Mah
528cea5d54
enh: Move iperf_printf's buffer off the stack. 2021-04-12 11:38:24 -07:00
Bruce A. Mah
f9bc608957
fix: Do a better job of counting bytes in iperf_printf. 2021-04-12 11:34:57 -07:00
Bruce A. Mah
9e244bb97f
fix: Fix a couple of buffer overrun hazards.
Pointed out by @berkakinci.

Fixes #1134.
2021-04-09 16:56:36 -07:00
Bruce A. Mah
8464c3c2bc
fix: Don't try to close the control connection if it never got opened. (#1136)
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).
2021-04-09 12:47:06 -07:00
David Bar-On
44c6fed2b6
Fix issue 1129 for not sending stat to to undefined socket (#1132)
This fix avoids trying to do operations on a socket that was never opened successfully.
2021-04-09 12:33:06 -07:00
David Bar-On
53a68308ba
Fix issue 1061 - not fail in WSL1 when cannot get default congestion alg name (#1126) 2021-03-15 12:18:00 -07:00
Bruce A. Mah
de006004d4
enh: Wording fixes in various messages, document --rcv-timeout in manpage.
Follow-up to #1123.

Pet copyrights where appropriate.
2021-02-26 13:49:00 -08:00
David Bar-On
8ffe72e24c
enh: Add --rcv-timeout option (#1125)
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.
2021-02-26 12:39:06 -08:00
David Bar-On
e22d530e2f
fix: Remove the inclusion of tcp.h as it is included by iperf.h (#1122)
This fixes a build breakage on Alpine Linux, where tcp.h was explicitly included in src/net.c before _GNU_SOURCE was defined in iperf.h.
2021-02-25 08:22:10 -08:00
David Bar-On
49a5771af1
IP don't fragment support (#1119)
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>
2021-02-16 14:28:54 -08:00
Bruce A. Mah
25f50c23a7
Issue 1118 (#1121)
* 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.
2021-02-08 14:54:11 -08:00
Hamid Anvari
410899785e
Fix/Optimize test termination condition check (#1114)
`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.
2021-02-05 16:04:56 -08:00
Hamid Anvari
de33801499
Fix iperf_send() termination test in bytes/blocks mode (#1113)
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.
2021-02-05 15:59:35 -08:00
Hamid Anvari
4e526a1a0b
API interface for setting/getting congestion control (#1036) (#1112)
Same restrictions/compatibility applies as
the CLI -C/--congestion options.
(Linux and FreeBSD only)

Fixes #1036
2021-02-04 15:16:38 -08:00
Bruce A. Mah
8f1efb68dc
fix: Don't write trailing NUL to pidfile.
Fixes #1120.
2021-02-04 08:47:13 -08:00
Wojciech Jowsa
fab96c1d96
Enable writing to pidfile in client mode (#1110) 2021-02-04 08:30:47 -08:00
David Bar-On
be66b57544
Server select timeout to prevent server to get stuck because of client or network errors (#1101) 2021-02-01 16:26:42 -08:00
Bruce A. Mah
d1cfda530f
chore: Copyright date bumps for 2021. 2021-01-15 11:10:06 -08:00
Bruce A. Mah
ce01004017
fix: Minor memory leak with -P. (#1103)
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.
2021-01-15 08:02:52 -08:00
Bruce A. Mah
21581a7216
enh: Support SO_BINDTODEVICE (#1097)
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>
2020-12-22 15:52:24 -08:00
Tony Weng
d1260e6f94
fix (tcp): Fix behavior with partial sends when using -k with TCP (#1082)
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.
2020-12-21 10:29:36 -08:00
jtluka
aeb0b3db11
iperf_server_api: start calculating CPU utilization right before TEST_START (#1077)
Fixes issue 1076.

Signed-off-by: Jan Tluka <jtluka@redhat.com>
2020-12-15 17:54:05 -08:00
Bruce A. Mah
d2a68e0896
Issue 1079 (#1091)
* docs: Add a few notes about RSA key formats used for auth.

* enh(auth): If we can't read key files, emit appropriate OpenSSL error.

Fixes #1079.
2020-12-07 14:10:56 -08:00
David Bar-On
91c33dcfd0
Bitrate throttling when burst is specified (#1090)
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.)
2020-12-04 08:26:53 -08:00
David Bar-On
50315e7a1e
Closing server prot_listener socket after stream setup failure (#1084)
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.
2020-12-04 08:19:08 -08:00
Bruce A. Mah
d3049a60fe
fix: Hide auth diagnostics behind --debug to avoid polluting JSON output. (#1087)
Fixes #1086.

While here, fix wording of an error message.
2020-12-01 09:14:36 -08:00
ralcini
bd1437791a
Configurable value for time drift between client/server for authentication request issue1065 (#1070)
* 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>
2020-11-11 17:27:47 -08:00
Bruce A. Mah
97a1d11abd
enh: Set TCP_NODELAY on control connections. Reimplementation of #1046. (#1063)
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.
2020-10-26 12:37:41 -07:00
Bruce A. Mah
98d87bd7e8
fix: Fix regression in #997 where JSON output was free-ed too early. (#1059)
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.
2020-10-01 13:28:12 -07:00
Bruce A. Mah
46047be9c2
Issue 1055 (#1057)
* docs:  Clarify the optional argument to the --timestamps option.

Fixes #1055.
2020-09-30 14:30:45 -07:00
A. Wilcox
2a1309faf8
fix[auth]: Ensure 64-bit time_t works on 32-bit systems (#1056)
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.
2020-09-30 10:29:33 -07:00
Bruce A. Mah
b818ef511a
Issue 982 (#1054)
* 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.
2020-09-18 10:16:21 -07:00