The original change overwrote closed file descriptors with -1
in the stream records to avoid them being used again, however
there were some cases in which the file descriptor numbers
were needed in output. This short-term fix reverts just that
part of the change to restore the output behavior.
* Close log file when cleaning up test
* Reset socket fds to -1 after closing
* Run server cleanup in error case
Prevent logfile fd leak in any case.
Fixes#1360
Previously, values like snd_(c)wnd were stored as int in struct
iperf_interval_results, while being handled as long before and double
after. This led to large values being wrongly printed as negative
values, e.g. when the product of snd_cwnd and tcpi_snd_mss in
get_snd_cwnd() resulted in a large return value.
This change is still not without issues. Ideally, the products of two
uint32_ts in get_snd_wnd() and get_snd_cwnd() would be returned as a
uint64_t. But that would make -1 unavailable as a placeholder for
missing values.
The problem was that the -k / -n parameters would get sent to the
server for a reverse tests, but never cleared for future reverse tests,
because these parameters were only sent from the client if they were
non-zero.
.
This is fixed in two ways as a belt-and-suspenders approach.
1. The server always clears the variables used for -k / -n when
receiving parameters, so if the client doesn't send them, they
get cleared (set to zero) anyway.
2. The client sends values for -k / -n even if they're zero. Sending
zero values doesn't hurt anything (except for wasting a few bytes),
and it makes this use case work even for servers that don't have
the fix in item 1 above.
Fixes#1363.
This updates some GNU autotools provided files that had gotten
stale over the past few years. Changes in #1335 should help
keep them up-to-date in the future.
Use the "%%" format specifier in usage_longstr when the desired output
is '%'.
Using the single '%' causes the '--help' output to be empty or condensed
on some versions of gcc.
Suppress following compiler warning when there is no HAVE_SENDFILE
support:
/lib/iperf3/src/net.c: In function 'Nsendfile':
/lib/iperf3/src/net.c:449:11: warning: unused variable 'offset' [-Wunused-variable]
449 | off_t offset;
| ^~~~~~
The current version of src/flowlabel.h is just a copy of linux/in6.h because it conflicts with "netinet/in.h".
But after linux >=v3.7 (adding uapi) this conflict was removed and this copy became useless.
I've added a Linux version check.
This fix is very useful for eg mp-tcp linux where iperf can build successfully.