1
1

46 Коммитов

Автор SHA1 Сообщение Дата
Bruce A. Mah
7af6d5a2f9
In debug mode, print out SO_SNDBUF when setting up each socket
(regardless of whether this was set explicitly or not).
2014-03-06 15:11:25 -08:00
Bruce A. Mah
4addea8502 Fix unfiled bug that could break TCP tests under some circumstances.
The bug and solution are very similar to Issue 126 (fixed in
d7e0c1445c0a).  Basically a setsockopt(IPV6_V6ONLY) call had a bogus
level argument, but we never checked the return value so we never
noticed this.

As with the prior issue, the fix is to unbreak the setsockopt() call,
and add some error checking to detect future breakage.

This bug was on a codepath that only got called if non-default values
were set for the socket buffer size, the MSS, or the NODELAY parameter.
It might have affected some FreeBSD tests, but really only got noticed
when debugging some other code that was (probably) cut-and-pasted
from this code.
2014-02-04 15:05:39 -08:00
Bruce A. Mah
0ff7575499 Fix build on Linux distros that don't support TCP_CONGESTION.
Apparently older kernels don't support TCP_CONGESTION, so we can't
just test for defined(linux) to know if we can use this sockopt or not.
This change unbreaks the build on (notably) CentOS 5.
2014-01-16 10:43:08 -08:00
Bruce A. Mah
48e66b9b9a Improve error message for TCP congestion algorithm setting failure.
Also remove a couple of places where we were saving and restoring errno
where we didn't need to.

Submitted by:	Susant Sahani <ssahani@redhat.com>
Issue:		121 (TCP congestion control algorithm support for client)
2014-01-02 13:49:56 -08:00
Jef Poskanzer
62bfa88ceb Added -C / --linux-congestion.
Also a few other bugfixes I ran across.
2013-12-13 19:57:52 -08:00
Bruce A. Mah
d04c7bd0a4 Support setting the IPv6 flow label on Linux systems (only).
This functionality uses some setsockopt(2) calls that unfortunately
don't seem to have an analog on other platforms.

Slightly tweaked version of a patch that was...

Submitted by:	ssahani@redhat.com
Issue:		40 (Option for setting Flow Label field in IPv6
		header)
2013-12-12 09:21:36 -08:00
Jef Poskanzer
32ebd649b3 Fixed some memory & fd leaks in error cases of various network setup
routines.
2013-11-09 14:23:36 -08:00
Jef Poskanzer
4e2ef5070b More sizeof changes.
A couple more sizeof issues found and fixed.  One of them is
actually another protocol change, but due to a fortuitous accident
it should remain compatible with older versions.

Detailed explanation: When a client attempts to connect to a server that
is already busy, the server is supposed to return ACCESS_DENIED as a
state value.  It was doing so, but was writing it as an int, even though
state values are supposed to be signed chars.  The client read the value
correctly as a signed char, getting one byte and throwing away the rest.
So why did this ever work?  Because ACCESS_DENIED is the value -1, and
any byte of an int -1 equals a signed char -1.  If ACCESS_DENIED had been
any other value, this would have been an opvious bug and would have long
since been fixed.  As is, it stuck around working by accident until now.
2013-11-06 11:05:46 -08:00
Jef Poskanzer
019434022c test->state needs to be explicitly signed char to accomodate a couple
of error states which are negative.  On most systems this doesn't
matter because char is signed, but on ARM CPUs char is unsigned.
2013-08-16 13:19:42 -07:00
Jef Poskanzer
c687db9da2 Storing the known-to-not-work Flow Label code, just to save it.
The user-visible parts are commented out or return a "not implemented
yet" error message.  The other parts are harmless.

We'll come back to this once we figure out how exactly one sets
the Flow Label.
2013-06-03 13:12:43 -07:00
Jef Poskanzer
12d474e2b4 A couple other places that used struct sockaddr_in when they should
have used struct sockaddr_storage - fixed now.
2013-05-02 15:28:30 -07:00
Jef Poskanzer
a6b3f26be1 Dual-stack operation - IPv4 and IP46 in the same server.
Also added -4 flag to force IPv4.
2013-03-29 17:49:27 -07:00
Jef Poskanzer
987b432316 A bunch of changes mixed together in this commit, but the significant
one is the new -Z flag.

- Fixed potential bug in net.c's Nread and Nwrite routines.  If they
had ever needed to loop they would have read/written the wrong address,
due to incorrect pointer arithmetic - sizeof(void) is not 1.  Fix
was to change the type of the buffer pointer to char*, which also
meant adding casts to some callers.

- Better checking for conflicts between command-line flags - now they
should no longer be order-dependent.

- Added a new -Z / --zerocopy flag, to use a "zero copy" method of
sending data, such as sendfile(2) instead of the usual write(2).

- Renumbered error enum to make inserting new ones easier.
2013-03-04 15:55:16 -08:00
Jef Poskanzer
43929b3698 Added "burst mode" to send a bunch of packets in a row without
intervening select() calls.  This increases performance quite a bit.
2013-02-22 15:54:05 -08:00
Jef Poskanzer
d7613a8e9f Allow API client to provide an fd for the client-side control socket. 2012-12-13 09:37:55 -08:00
Jef Poskanzer
ec2d0670b8 Switched to using a new timer package, adapted from thttpd and http_load. 2012-12-11 22:29:26 -08:00
jef
98ce496b1b Some changes to the iperf3 API to work with bwctl, mostly having to
do with what defs are in which include file.  End result is we now have
only one public include file, iperf_api.h.
2012-09-28 16:00:14 -07:00
Jon Dugan
7d375156aa update license info for all source files 2011-04-20 20:33:09 +00:00
sethdelliott
02a35f07e3 Merged print mss (-m) into verbose mode (-V) 2010-08-04 19:19:08 +00:00
sethdelliott
0bd8d9da6e Added ability to set TCP window size (-w). Modified code to keep test structures intact after a test is complete. Improved interval timer granularity. Fixed a bug with timeval_diff. 2010-08-02 22:45:53 +00:00
sethdelliott
f99bd3b2c6 Added support for IPv6 mode (-6) 2010-07-27 20:27:34 +00:00
sethdelliott
5e0e1e974e Exchanged gethostbyname for getaddrinfo 2010-07-27 17:32:21 +00:00
sethdelliott
a1344ede16 Added support for binding (-B) to a specific interface 2010-07-26 21:30:34 +00:00
sethdelliott
112a907cc3 More code restructuring 2010-07-23 18:39:14 +00:00
sethdelliott
66ce7ad49d Made the protocol implementation better. Lots of code clean up 2010-07-22 23:26:38 +00:00
sethdelliott
8a0b5a5d18 Added support for adding new protocols. Slightly modified iperf_error() 2010-07-22 18:57:08 +00:00
sethdelliott
b60a49dd37 All error handling is now handled by iperf_error. Also cleaned up some code 2010-07-20 22:27:50 +00:00
sethdelliott
8556db5d08 Added support for UDP mode (-b mode not yet supported). Added htonll/ntohll functions. Cleaned up code. 2010-07-14 23:24:58 +00:00
Jon Dugan
b0b16b86cc rename uuid.[ch] to iperf_util.[ch] to avoid confusion on some platforms 2010-07-09 00:29:51 +00:00
sethdelliott
f1b3bd81f9 Quite a bit of code restructuring. 2010-07-07 21:54:24 +00:00
sethdelliott
181d61afab Iperf results are now exchanged between client and server. The server also now prints results. 2010-06-29 22:02:30 +00:00
sethdelliott
fd10304cbd Updates to Nread/Nwrite in net.c 2010-06-28 22:25:03 +00:00
sethdelliott
465b565c50 New control socket design now works. Now working on finishing up the reporting. 2010-06-23 19:13:37 +00:00
sethdelliott
ba2672a209 Note: The redesign is almost working. Should be finished shortly. 2010-06-21 15:08:47 +00:00
sethdelliott
982c704a8a NOTE: This is not a working revision. I'm in the process of redesigning how the client and server communicate. It will be fixed soon 2010-06-18 21:08:50 +00:00
Brian Tierney
6146bde494 fixed stats computation 2009-11-17 18:44:01 +00:00
Brian Tierney
1882b9cb65 turned off some debug code, and fixed a bug in interval times 2009-11-15 04:47:19 +00:00
Brian Tierney
97887027e7 completely reworked stats collection/display code. Mostly working again, and much more readable. 2009-11-15 04:29:47 +00:00
Brian Tierney
e99faeae86 more cleanup and bug fixes 2009-11-10 04:41:42 +00:00
Brian Tierney
a3281a3dc6 parallel streams now mostly working. Still some issues with repeated connections 2009-11-06 07:25:10 +00:00
Brian Tierney
150a09e9e2 refactoring of state machine now complete! works for single stream TCP only at the moment 2009-11-06 02:19:20 +00:00
Brian Tierney
8f4e66c9d0 interrim commit: work in progress 2009-11-06 01:43:50 +00:00
Brian Tierney
8d41fbd712 more bug fixes, still needs work 2009-11-03 06:38:09 +00:00
Brian Tierney
c27f38e5be more work on state cleanup: not yet done 2009-11-03 05:37:06 +00:00
Brian Tierney
a36921c2dd state machine cleanup (still in progress) 2009-11-02 23:56:55 +00:00
Brian Tierney
a951c98062 lots of code restructuring 2009-11-02 22:43:19 +00:00