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

692 Коммитов

Автор SHA1 Сообщение Дата
Bruce A. Mah
73b02f9819
Implement daemon(3) for systems that don't have it.
Fixes (and based on a patch in) #369, with some reworking by @bmah888 and @pprindeville.
2017-11-11 10:12:55 -08:00
Bruce A. Mah
95d408962a
Add function declaration for our getline() compat implementation.
Should have been a part of #663, which fixes #607.
2017-11-10 12:04:35 -08:00
Bruce A. Mah
d06415822a
Regen after merge of #663. 2017-11-08 10:19:49 -08:00
Bruce A. Mah
cb2dcd3f6d
Provide a getline(3) implementation for systems without it. (#663)
The getline(3) implementation comes from NetBSD's file(1) command.
This should make compiling work on macOS pre 10.7.  Fixes #607.
2017-11-08 10:18:30 -08:00
Philip Prindeville
d88f4cecf3 Fix 3.3 build warnings (#664)
* Fix warnings about _GNU_SOURCE being redefined.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>

* Fix warnings of format-specified mismatching type

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>

* Simplify endianness checks

Linux can be built with too many types of C run-time library and it's
not reasonable to have to enumerate all of them, especially since at
least one of them (MUSL) goes out of its way to not be easily
detectable.

Instead, leverage autoconf better for Linux/BSD to detect either
<endian.h> or <sys/endian.h> directly.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>

* Sys headers should not be included directly

There's usually a top-level header which then includes the sys/
descendent.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-11-08 09:29:26 -08:00
Boris Okunev
d60f6234d5 Issue #659 (#660)
Ignore nonsensical TCP MSS when trying to compute the default UDP packet size.  This fix seems to be primarily needed for Windows systems, but it's a good bit of sanity checking to do in any case.
2017-10-27 14:38:08 -07:00
Bruce A. Mah
010fc7e6c8 Don't overwrite a PID file corresponding to a valid process. (#654)
This fixes a problem described in issue #623 where the PID file
opened by a running instance of iperf3 could be overwritten /
deleted by a subsequent invocation of iperf3.
2017-10-25 10:04:26 -07:00
Bruce A. Mah
24da2caa09 Fix memory leak introduced in 1460aa3433. (#652)
Pointed out by:  @pprindeville
Should have been found by:  @bmah888
2017-10-13 11:01:06 -07:00
ralcini
1460aa3433 fix for https://github.com/esnet/iperf/issues/650 (#651)
Reset authentication token between tests.  Fixes #650.
2017-10-11 14:03:57 -07:00
Bruce A. Mah
b5640ac6c2 Clear TOS value when resetting test parameters. (#647)
This addresses a problem where the --tos parameter would incorrectly
"stick" on the server, causing wrong TOS values to be inserted into
packets during --reverse tests.  Fixes #639.
2017-10-11 12:10:11 -07:00
Bruce A. Mah
720a0a3e63 Allow the client to pass a duration of 0 to the server. (#648)
Seems to fix #645.
2017-10-11 11:05:55 -07:00
Bruce A. Mah
25f5947512 Fix a problem formatting very large numbers. (#642)
Avoid walking off the end of an array when trying to format a number larger than 1000T.

Motivated by #641, as reported by @shingchuang, but slightly
reimplemented.
2017-10-04 10:15:19 -07:00
Malte
b2900fd710 Delete outdated comment
This comment became outdated with cba8584b2
2017-10-04 02:09:30 +02:00
Bruce A. Mah
ca954c7668
Reverse the order of tests for better legibility and logical sense.
Suggested by @pprindeville.
2017-09-19 09:14:24 -07:00
Bruce A. Mah
d6a6751746
Two fixes for a warning for possibly-too-large UDP packets.
1.  Make sure we have a valid TCP MSS on the path when comparing
the UDP block size.

2.  Fix a redundant "warning".

This should fix a bug observed on Windows but not (so far) on any
UNIX-like platforms.  Fixes #608.
2017-09-18 15:17:18 -07:00
Bruce A. Mah
7cf95d205d
Regen. 2017-08-14 13:46:35 -07:00
Philip Prindeville
517ad2248f Add required RSA header for OpenSSL (#622)
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-08-01 11:16:07 -07:00
Bruce A. Mah
dadbd25838
Fix spelling mistake in manpage.
Fixes #610, pointed out by @borenius-dfn-de.
2017-07-17 08:22:45 -07:00
Bruce A. Mah
4f3a7a5403
Greatly expand description section.
Based on text by @eriitguy, fixes #480.
2017-06-20 15:04:30 -07:00
p0intR
946a5a0f15 Close ctrl_sck iperf_client_end() (#597)
This avoids a leak of file descriptors.
2017-06-12 09:42:21 -07:00
Bruce A. Mah
b0aff8490a Fix a few printf format string warnings seen on macOS / clang. (#593) 2017-06-05 10:57:07 -07:00
Bruce A. Mah
b5597278b5 Towards issue #278. Don't print small, dataless last intervals. (#592)
This is mostly a cosmetic fix...due to timing differences or
interference from data packets, it is possible that the server
will have a very small last measurement window, possibly with
no data transferred.  This looks odd (although it's not incorrect)
and we'd like to eliminate these.  If there's an interval
(presumably it'd be the last measurement interval) less than
10% of the length of a standard measurement/reporting interval,
and there are no bytes transferred in the interval, then suppress
printing the results and don't add them to the grand total.
2017-06-05 10:38:36 -07:00
Bruce A. Mah
7f06146221 Fix out-of-order / loss counting issues with UDP (#457) (#589)
* Towards issue #457.  Try to not count the sequence number
gaps resulting from out-of-order packets as actual losses.

* Put all of the UDP diagnostic output behind the --debug flag.
2017-06-02 09:35:19 -07:00
Bruce A. Mah
c458a115b7 Fix -F problems (#588)
Attempt to fix some brokenness in -F from #301.

In some work related to #125, we introduced a bug in which
chunks of a file being read for the -F option were not
completely sent, particularly with TCP sockets.  We attempt
to fix this by detecting cases in which not all data passed
to a socket could be actually sent (for example due to full
socket buffers) and preserving that data for future send
iterations.

The ending statistics in the "diskfile" JSON structure were
wrong, and did not properly distinguish between sender-side
and receiver-side statistics.  This has been fixed (at least
for the client side).

Specifically mention in the manpage that "iperf -F" is not
a file transfer tool.
2017-05-30 14:15:28 -07:00
Kenneth Wong
acb4c4c9d5 Improve C++ compatibilty (#587)
Improve the compatibility of iperf_api.h with C++ so that libiperf can more easily be used with C++ programs.

This involves function declarations as extern "C" and inclusion of a couple of more headers (which arguably improves the C use case).
2017-05-30 13:30:08 -07:00
Bruce A. Mah
39de1e0f27
Merge branch 'master' of github.com:esnet/iperf 2017-05-24 11:08:37 -07:00
Bruce A. Mah
3410d58fdc
Silence a warning for an unused variable. 2017-05-24 11:08:15 -07:00
Bruce A. Mah
0f081b7b2e Issue 583 (#586)
* s/bandwidth/bitrate/ in user-facing places.  Towards #583.

iperf3 has long misused terminology; bandwidth is a measure of
capacity.  iperf3 measures bitrate or throughput.  We standardize
on "bitrate" because it begins with the same letter as "bandwidth"
(to match the -b command-line option).

User-facing output mentioning "bandwidth" now uses "bitrate".
The long command-line option for -b (--bandwidth) is now --bitrate
(--bandwidth is transparently accepted for backward compatibility).
A few places in documentation that talk about bandwidth as a
measured value have been reworded to use bitrate or throughput.

There are a number of places in code where variables are still
called "bandwidth".  We leave these alone for now.

A mention of "bandwidth" in the test parameters JSON also needs
to remain unchanged to avoid breaking compatibility.  However,
the test results JSON never used the term "bandwidth" in
the first place.

* s/bandwidth/throughput in one place in RPM description.  Towards #583.
2017-05-24 10:50:44 -07:00
Bruce A. Mah
7a15a7ae85 Fix another compiler warning. 2017-05-23 13:05:09 -07:00
Bruce A. Mah
dc74346f26
Fix compiler warning with clang. 2017-05-23 12:52:16 -07:00
Sami Farin
e7ab564cb5 Return random ascii-string in make_cookie. (#582)
Having hostname and microsecond timestamp in the cookie is not
necessary.  Also fill test buffer with data from /dev/urandom
instead of using random().
2017-05-21 11:30:18 -07:00
Bruce A. Mah
2541b86174
Bump manpage date. 2017-05-18 16:39:55 -07:00
Brian Tierney
0c4d5992fd clarified a couple options 2017-05-18 11:43:50 -07:00
Bruce A. Mah
9d7d60aca1 Issue 216 (#581)
* Add configurable timeout for the setup of the control connection.
This is specified using the new --connect-timeout option, with an
integer parameter in ms.  The iperf3 client will wait for this
amount of time for the setup of the control connection to the
server.  If this option is not given, the OS default for TCP
connection setup is used.  Specifying a smaller connection timeout
allows faster detection of a down / unresponsive iperf3 server.

The implementation uses a variation on the timeout_connect()
function from OpenBSD's netcat utility.

Fixes #216.
2017-05-17 12:50:50 -07:00
Bruce A. Mah
52375c105a Grab TCP PMTU during tests (on Linux only). Towards #569. (#578) 2017-05-12 13:42:50 -07:00
Bruce A. Mah
d54d49c0ac
Don't free memory in uninitialized structures
Also, tighten up the scope/lifetime of some memory structures.

Inspired by #577.
2017-05-12 09:12:48 -07:00
Bruce A. Mah
35ec9e545a Bunch of reporting fixes found while investigating bug #236. (#575)
For the case of multiple TCP streams, compute the grand total
summaries using the appropriate times for the sender and receiver
ends.

Add some divide-by-zero checks.

On the server side, only print the side of the grand total lines
where we have data.  (This follows the behavior of the other
end-of-test output lines.)

Fix a minor (compared to all the other problems) bug with
UDP output printing the wrong ending timestamp.
2017-05-11 14:12:16 -07:00
Bruce A. Mah
8f0d9c47ec
Print the cJSON version in our version info. 2017-05-11 12:31:22 -07:00
Bruce A. Mah
c71712875a Fix NaN in summaries with a client talking to an iperf 3.1/3.0 server.
Recent code changes require the server to send the start and end
timestamps for a test, so that the client can accurately compute
statistics for the sender side of a test.  iperf 3.1 and 3.0
servers won't do this, so if this information isn't passed back
in the results at the end of a test, we fall back to using the
client's timestamps.  The results might not match what's displayed
on the server, but this is basically what iperf 3.1 and earlier
did anyway.

Fixes #574.
2017-05-11 11:40:14 -07:00
Bruce A. Mah
cab5dba86c Import cjson 1.5.2 (#573)
* Import source files for cJSON 1.5.2.

* Portability and 64-bit changes for cJSON.
2017-05-11 10:17:34 -07:00
Bruce A. Mah
e255a12eb9 Fix problems in human-readable UDP output
Keep track of UDP packets sent/received and use appropriately.

We were using the number of UDP packets seen on the server
(regardless of whether it was the sender or receiver) for
computing loss percentages, etc.  This caused confusion in the
case that the last UDP packet doesn't make it to the server
before the test finishes (or if a packet gets lost), because
the client and server had different ideas of how many packets were
sent (OK) and we used the wrong number when computing statistics.

This fix changes the human-readable output to make more sense.
It doesn't change the JSON output.  That needs some more review.
I'm reluctant to make structural changes to the JSON output,
because other programs rely on that format.

We also need to investigate whether the last UDP packet can be
still in flight when the test ends (per hypothesis), and if so
what we should do about this.

We apply similar fixes for human-readable summaries for multi-stream UDP tests.

The fixes are similar to those already done for the stream
summary statistics, but these cover a type of output that's only
done if there is more than one stream.

Adjust the JSON computations / output to do a better job of figuring
out the total number of packets sent.

We really need to disentangle the computation and output formatting,
these two operations shouldn't be mixed together like this.

Fixes #252.
2017-05-09 14:29:22 -07:00
Bruce A. Mah
37d913dfcc Improve error handling and documentation for -f/--format. (#568)
We now reject all invalid format characters given as the
argument to the -f/--format flag.  All valid characters are now
documented in the usage message and manual page.

Towards #566.
2017-05-08 10:01:15 -07:00
Bruce A. Mah
67653543ad
Improve / fix comments regarding UDP jitter calculation.
Internal documentation fix only, no functional change.
2017-05-05 08:59:13 -07:00
Bruce A. Mah
103d4318e8 Fix a heap corruption issue leading to a server-side crash. (#564)
Commit 5ab2132c (PR #551) fixed, among other things, a memory
leak.  The solution, however, causes a hazard where a free() of
an invalid pointer can corrupt the heap.  We've observed this
fairly repeatably while running the test_commands.sh script on
CentOS 7.

To remedy this, we NULL out a pointer after the object it
pointed to has been free-d, just like a number of other similar
objects.
2017-05-04 14:16:42 -07:00
Bruce A. Mah
5abc5f29b7
IRIX 6.5 compatibility, via a patch from @canavan in #368.
Not independently tested.
2017-05-04 09:03:43 -07:00
Bruce A. Mah
cba8584b2d Pacing timer (#563)
* Add --pacing-timer option to allow tuning of -b timers.
These control the granularity of the timer and hence burstiness
of iperf3's sends.  The default is 1ms (1000), which is the default
starting with iperf 3.2.  Follow-on to the commit in #460.

* Update manpage and release notes for --pacing-timer.
2017-05-03 16:18:32 -07:00
Bruce A. Mah
e73821cd03 Normalize socket buffer debugging output, put socket buffer sizes in JSON.
These values show up in the start structure as sock_bufsize (requested
size), sndbuf_actual (actual SO_SNDBUF value) and rcvbuf_actual (actual
SO_RCVBUF value).  These values are available for both TCP and UDP.
Both client and server emit these values in their JSON output for their
respective sides, but don't exchange them.

Towards #558.
2017-05-03 14:03:22 -07:00
Bruce A. Mah
246c1bcacd Remove some dead code. 2017-05-03 12:25:32 -07:00
Bruce A. Mah
10e2cc241e Fix various problems with summary statistics (#562)
* Untangle some problems with printing summary statistics.

There were (at least) two problems:

o The server cannot print summary statistics as seen from the
client, because the server has to generate its summaries
before receiving any statistics from the client.  This
shortcoming is somewhat hard-coded into the semantics of
messages on the control channel, and probably can't be easily
changed.

o UDP summary statistics for each stream were ambiguous in that
it wasn't clear whether they were intended to apply to the
sender or receiver.

To fix this, we split UDP summary statistics into two lines,
one for the sender side and one for the receiver side.  This
hopefully eliminates any ambiguity about the statistics.  On the
server, we don't attempt to print the (not very meaningful and
potentially misleading) statistics corresponding to the client.

Possible fix for #560.

* Try to report more accurate ending statistics.

Basically the client side was using only its measured test duration
to compute figures such as bitrate, but the server's test duration
could be different due to network delays/jitter.  So we make sure
that the test durations (for each stream) are passed in the test
results and used appropriately when we print statistics for the
sender and receiver.

Towards #560, also this could help towards #238.

* Silence a warning over an uninitialized variable.
2017-05-03 10:21:34 -07:00
Bruce A. Mah
c8531ca31f
Fix possible integer overflow in tera prefix conversions.
Follow-on commit for #402, possible fix for #561.
2017-05-02 10:21:59 -07:00