aboutsummaryrefslogtreecommitdiff
path: root/src/iperf_api.c
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@es.net>2014-10-13 08:55:41 -0700
committerBruce A. Mah <bmah@es.net>2014-10-13 08:55:41 -0700
commit96d0c77ca24da07d52f8d1c20301c202e4f0360b (patch)
tree6d9a3d136ef06b4ea609823c88b5e0b3a96f5380 /src/iperf_api.c
parent8694d1db0d0b95ea76ca2bfce79a01e48290bfce (diff)
downloadiperf3-96d0c77ca24da07d52f8d1c20301c202e4f0360b.tar.gz
The maximum send length for UDP is the maximum size of a UDP datagram.
For UDP over IPv4, this is the maximum IPv4 packet size (65535) minus the size of the IPv4 and UDP headers, arriving at 65507. In theory for a system implementing IPv6 jumbogram support, there is no maximum packet size for UDP. In practice we've observed with CentOS 5 a limitation of 65535 - 8, which is dictated by the size field in the UDP header (it has a maximum value of 65535, but needs to count both payload and header bytes, thus subtracting off the 8 bytes for the UDP header). We take the most conservative approach and use the 65507 value for UDP / IPv4. This is (I believe) the last part of issue #212.
Diffstat (limited to 'src/iperf_api.c')
-rw-r--r--src/iperf_api.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/iperf_api.c b/src/iperf_api.c
index 4596c55..0d38f8d 100644
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -913,6 +913,11 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
i_errno = IEBLOCKSIZE;
return -1;
}
+ if (test->protocol->id == Pudp &&
+ blksize > MAX_UDP_BLOCKSIZE) {
+ i_errno = IEUDPBLOCKSIZE;
+ return -1;
+ }
test->settings->blksize = blksize;
if (!rate_flag)