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

887 Коммитов

Автор SHA1 Сообщение Дата
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
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
Bruce A. Mah
70c85f62df
fix: Unbreak build on CentOS 6. (#1040)
The fix eliminates a duplicate definition of the iperf_size_t datatype
when both iperf.h and iperf_api.h are included.

Fixes #1039.
2020-08-14 13:25:51 -07:00
Bruce A. Mah
e551fbcfc2
fix: Remove debugging code that shouldn't have been committed.
Thanks to @rantala for finding this.

Follow-on to #1023 / #1033.
2020-08-12 15:06:58 -07:00
Bruce A. Mah
80b7c7b271
fix: Plug various minor memory leaks (#1033)
* fix: Fix memory leaks related to --logfile.
* fix: Fix memory leaks related to loading RSA keys.
* fix: Fix some memory leaks in failure cases in the iperf3 client.

Fixes #1023.
2020-08-03 17:49:27 -07:00
Bruce A. Mah
a9c28038c0
fix: Emit error message for an unknown i_error, rather than an empty string. (#1030)
Suggested by @david-BarOn.

Towards #1022.
2020-07-24 17:32:00 -07:00
Bruce A. Mah
1a908ce13e
feat: Add a --timestamps flag to prepend a timestamp per output line. (#1028)
This flag takes an optional argument, which is a format specification to strftime(3)...this allows for custom timestamp formats.  Based on a suggested implementation by @davidBar-On.  Towards #909.
2020-07-23 07:52:46 -07:00
Bruce A. Mah
d5d2e2473f
fix: Correctly emit an error message when unable to get a password. (#1026)
This occurs when iperf3 is being run with authentication and it
tries to get a password interactively, but there's no tty available.

Fixes #1024.
2020-07-10 16:31:41 -07:00
Bruce A. Mah
223da98090
Issue 999 follow up (#1025)
* doc: Add manpage text for --server-bitrate-limit.

While here, normalize the manpage text for all command-line options
that take [KMGT] scaling suffixes (there were about three different
strings in use).

* doc: Bump manpage date.

* fix: Fix printf format string warnings on macOS.

* fix: Fix compatibility definition of PRIu64 in iperf_udp.c to match iperf.h.
2020-07-10 15:29:47 -07:00
David Bar-On
a0c6f0eca9
feat: Issue #937 - Add a server option to limit total allowed throughput (#999) 2020-07-10 08:36:40 -07:00
Yun Jiang
5e7ea0bd1e
fix: Prevent 100% CPU usage when --bidir option is enabled. (#1011) 2020-07-07 08:01:35 -07:00
David Bar-On
3888e044c3
chore: Change applicable function arguments from 'char *' to 'const char *' (#1006)
Fixes #946.  Should not present any functional changes.
2020-06-12 10:03:30 -07:00
Stefano Garzarella
0b0aa349fa
Fix warning: "HAVE_SCTP" redefined (#1010)
The netinet/sctp.h header file defines HAVE_SCTP, so we have this
warning while building:

    In file included from ../../src/iperf.h:30,
                     from ../../src/iperf_sctp.c:46:
    ./iperf_config.h:44: warning: "HAVE_SCTP" redefined
       44 | #define HAVE_SCTP 1
          |
    In file included from ../../src/iperf_sctp.c:43:
    /usr/include/netinet/sctp.h:56: note: this is the location of the previous definition
       56 | #define HAVE_SCTP
          |

This patch replaces our HAVE_SCTP definition with HAVE_SCTP_H to avoid
this warning.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2020-06-12 09:28:15 -07:00
Bruce A. Mah
f95924ddcf
chore: iperf-3.8 release engineering changes (#1012)
Updates version numbers, release notes, etc.
2020-06-08 13:12:36 -07:00
Bruce A. Mah
99b79f2102
fix: Fix stupid memory leak. (#1005)
Pointed out by @oleh-yudin-ring.  Follow-up to #996.
2020-05-22 12:09:26 -07:00
Bruce A. Mah
33d3b199e6
Regen. 2020-05-20 14:36:48 -07:00
Bruce A. Mah
5b7b99ed81
Add tests for iperf_api functions. 2020-05-20 14:35:52 -07:00
Bruce A. Mah
06e3f08d98
fix(auth): Fix a potential buffer overflow in iperf3 client.
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.
2020-05-20 14:34:11 -07:00
Bruce A. Mah
79630e8734
fix: Fix memory management issues around calls to cJSON_Print() (#997)
Related to #883.
2020-05-19 07:44:09 -07:00
Bruce A. Mah
de848cffad
feat(api): Provide API access to --commit-timeout. (#1001)
Fixes #1000.  Part of #595.
2020-05-19 07:37:18 -07:00
Bruce A. Mah
2609dd7123
fix(udp): Properly initialize for the first UDP packet received. (#990)
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.
2020-05-12 16:26:55 -07:00
Bruce A. Mah
1521d9b522
bug(udp): Fix minor problem in a debug message. (#995)
Fixes #993.  Submitted by @davidBar-On.
2020-05-11 12:21:26 -07:00
Bruce A. Mah
06280a6d01
Regen. 2020-05-04 15:11:05 -07:00
Michal Ruprich
e39e44fdfd
Fix for possible leaks or double frees (#968) 2020-05-04 15:05:18 -07:00
Bruce A. Mah
624c01d444
chore: Fix whitespace glitch that caused a compiler warning on Ubuntu 18.04.
Whitespace-only change, no functional difference.
2020-04-14 17:03:04 -07:00
Bruce A. Mah
6c10d8a0f3
enh: Update cJSON to 1.7.13 (#978)
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).
2020-04-14 16:59:56 -07:00
Stefano Garzarella
23cd3ddc86
fix (iperf_api): fix compiler warning while printing an uint64_t (#969)
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>
2020-03-27 15:03:56 -07:00
Tamir Duberstein
120b7efee9
fix: include iperf_util.h in main.c (#954)
73b02f9 implemented `daemon(3)` for systems that don't have it, but the
function prototype was never included in `main.c` where it is
referenced.
2020-03-17 13:58:49 -07:00
Bruce A. Mah
cfcfabf5d7
fix(cygwin): Fix compile error where CPU_SETSIZE isn't defined. (#948)
Based on a fix from @RomelSan.

Fixes #944.
2020-03-17 13:51:07 -07:00
Oleh Yudin
bb115306f8 Fix memory leaks for RSA key setters (#949)
Originally discussed in #940.
2020-01-06 16:33:06 -08:00
Bruce A. Mah
4a3efb37da
build: Unbreak builds on macOS by not building profiled binaries by default (#950)
Fixes #933.
2020-01-06 13:43:29 -08:00
Xiang Xiao
4e9a30bba3
fix cjson warning: "true" and "false redefined
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>
2020-01-03 13:47:44 -08:00
Xiang Xiao
6343986796
ensure build_tcpinfo_message TCP_INFO check consistent with iperf_interval_results
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>
2020-01-03 09:07:03 -08:00
Xiang Xiao
666040bd79
fix hotn?, strcasecmp and timeval isn't defined error
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>
2020-01-02 15:58:20 -08:00
Xiang Xiao
0eb370de2e
check SIGINT/SIGTERM/SIGHUP defined before using them
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>
2020-01-02 15:54:19 -08:00
Xiang Xiao
407a5ba84c
fix warning: "HAVE_NETINET_IN_SYSTM_H"/"HAVE_NETINET_IP_H" is not defined
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>
2020-01-02 13:19:30 -08:00
Xiang Xiao
a0af1e68c8
change some file mode from 100755 to 100644
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>
2020-01-02 13:16:47 -08:00
Bruce A. Mah
a294bd4ce7
fix: Copy some strings passed as API parameters for consistency with CLI. (#943)
Fixes #939.
2019-12-20 15:39:26 -08:00
Bruce A. Mah
79e1cd35b5
fix: Make prototype for iperf_set_test_extra_data() match its definition.
Fixes #938.
2019-12-20 21:57:47 +00:00
wallyatgithub
02a5f47558 add window size support for sctp (#926) 2019-11-01 12:10:15 -07:00
Ondrej Lichtner
80353b0ada fix: fix burst mode throttle checking (#898)
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>
2019-10-01 16:55:14 -07:00
Allen Flickinger
22da02dcfb enh: Add server authentication API functions (#911) 2019-10-01 13:28:38 -07:00
Sergey Nemov
9c69a85088 fix: Fix a bug in --bidir option processing (#903)
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.
2019-08-19 14:29:27 -07:00
Bruce A. Mah
c47e43d5a3
doc: Document --bidir option in manpage. (#893)
Fixes #890.
2019-06-24 17:37:32 -07:00
Bruce A. Mah
38bac802fa
fix: Emit appropriate error messages from getaddrinfo(3). (#888)
* fix: Emit appropriate error messages from getaddrinfo(3).

This fixes an omission likely caused when switching resolver
library calls.  Fixes #846.
2019-06-18 16:03:21 -07:00
Bruce A. Mah
c4bd56f373
fix: Fix off-by-one memory overwrite crash and memory leaks (#887)
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.
2019-06-18 15:11:32 -07:00
Andrew Cooks
098dd3cc1b
delay tearing down tcp control connections
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)
2019-06-14 11:38:54 -07:00
Bruce A. Mah
6c7834629a
Fix: Don't allow --port 0 or other invalid values. (#885)
* Fix:  Don't allow --port or --cport to take 0 or other invalid values.

Fixes #884.
2019-06-14 11:21:15 -07:00
srgnk
255a9c7110 enh: Introduce iperf_set_test_logfile API function (#871)
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.
2019-06-05 16:08:17 -07:00
Bruce A. Mah
fd46367fc4
feat: Authentication failure doesn't count for --one-off. (#877)
Fixes #864.
2019-06-05 15:54:22 -07:00
srgnk
2679640c0f fix: Don't print spurious JSON server output in bidir mode (#868)
In bidirectional mode, if option --get-server-output is set and if
both client and server have --json set to true, client would still print
the json output of server to stdout as a separate piece instead of
including it into client's json output.

This patch fixes this problem, the server's json output would be
appended to client's json field 'server_output_json' as it should be.
2019-05-28 12:02:07 -07:00
Bruce A. Mah
7c9b553c7d
enh: Properly include <sys/socket.h> for improved portability. (#874)
Fixes #821.
2019-05-17 14:14:05 -07:00
srgnk
a9af2b5127 enh: Introduce API functions for no_delay option (#870) 2019-05-17 13:39:40 -07:00
srgnk
8fc10fa34b enh: Introduce API functions for repeating_payload option (#869) 2019-05-17 13:38:58 -07:00
srgnk
e9e984de2b fix: Pass repeating_payload option to server (#867)
If client was started with --repeating-payload option, tell the
server to use the repeating_payload also.

Since repeating_payload is a client specific option at the moment and
we don't tell the server if repeating_payload was set not not,
server always uses randomized patterns in reverse and bidirectional
modes disregarding what patterns the client was told to generate.

So, if client was started with both --repeating-payload and --reverse,
the server would still send the randomized data to the client which
doesn't seem right.

This commit fixes this issue.

Signed-off-by: Sergey Nemov <sergey.nemov@intel.com>
2019-05-17 13:21:31 -07:00
Bruce A. Mah
c9bb46938c
Partially revert documentated added in 0c4d599 to reflect reality. (#866)
The bug reported in #505 seems to not exist at this time, and
the text added in this manpage change caused some other problems,
a la perfsonar/pscheduler#819.

Fixes #860.
2019-05-14 14:41:22 -07:00
Bruce A. Mah
61b82c0b25
fix: Use timezone from time formatting, not a (wrong) hardcoded string. (#857)
Fixes #838.
2019-04-12 17:21:19 -04:00
Bruce A. Mah
8b9c59b3ec
fix: Remove Linux-ism in clock_gettime(3). (#853)
Fixes build on FreeBSD.  Possible fix for #829.
2019-03-29 15:52:56 -07:00
Matt Pelland
40e7c05440 implement providing password via environment variable (#815) 2019-02-01 14:39:43 -08:00
Tommi Rantala
d607579929 Fix cpu usage calculation regression in cpu_util() (#822)
iperf reported "impossible" CPU usage percentages in JSON output:

    "cpu_utilization_percent":      {
        "host_total":   70907445.679701567,
        "host_user":    1303335.9336584355,
        "host_system":  69604109.746043131,
        "remote_total": 13580675.258652203,
        "remote_user":  540984.0827233647,
        "remote_system":        13039620.331720918
    },

Regression introduced in commit cde81d7 ("Add initial portable time
abstraction"), where "timediff" was accidentally changed from
microseconds to seconds:

  -    timediff = ((temp.tv_sec * 1000000.0 + temp.tv_usec) -
  -                (last.tv_sec * 1000000.0 + last.tv_usec));
  +    iperf_time_diff(&now, &last, &temp_time);
  +    timediff = iperf_time_in_secs(&temp_time);
2018-12-13 13:43:02 -08:00
Frank LENORMAND
901ad59c83 tcp sctp: Let the system pick the largest possible backlog value for listen() (#827)
This commit applies the same changes made by b481169 (#693), to the
TCP and SCTP server sockets.
2018-12-13 13:32:49 -08:00
Boris Okunev
0778f04c98 Bidirect mode implementation (#780)
Adds the `--bidir` flag to support simultaneous two-way tests.

Submitted by @LikHait.  Fixes #201.
2018-12-13 12:59:02 -08:00
Bruce A. Mah
64d1be0fcc
Regen. 2018-09-28 11:07:28 -07:00
Bruce A. Mah
d13fa7ce39
Merge branch 'iperf_time' of https://github.com/accelleran/iperf into accelleran-iperf_time 2018-09-28 10:35:23 -07:00
RollingSlack
197d27ac76 Show client's target bitrate (-b/--bitrate) in server output (json,verbose) (#776)
Fixes #599.
2018-09-28 09:37:38 -07:00
Bruce A. Mah
af34c411df
Flush (if appropriate) after a server-side message where we weren't before. (#795)
Also fix some stupid looking code and update a copyright.
Fixes #790.
2018-09-17 13:35:16 -07:00
Bruce A. Mah
d95891b812
Document --udp-counters-64bit in manual page. (#796)
Fixes #791.
2018-09-17 13:32:15 -07:00
Bruce A. Mah
d71efe5ff5
Fix a segmentation fault in verbose mode. (#784)
To reproduce, run the server as "iperf3 --server --verbose" and
run a client as "iperf3 --client localhost -reverse --parallel 2".
Fixes #778.

Based on https://github.com/Aquantia/iperf/commit/f1778271d2c6bed1dae09dccd33251
1b263f6871
2018-08-22 14:11:05 -07:00
Boris Okunev
da6eebb521 Fixed function implementation (#775)
* Fixed implementation of function set_test-reverse().

* Correct/improve some other checks
2018-08-14 15:47:21 -07:00
Bruce A. Mah
cf1f1a3d36
Regen. 2018-08-09 12:38:31 -07:00
RollingSlack
beac6881e6 Add libiperf api for getting iperf version (#767)
Also includes a test program.
2018-08-09 12:36:54 -07:00