diff options
-rw-r--r-- | src/iperf_tcp.c | 16 | ||||
-rw-r--r-- | src/iperf_udp.c | 32 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c index 3fbd1a3..2bd905e 100644 --- a/src/iperf_tcp.c +++ b/src/iperf_tcp.c @@ -426,13 +426,13 @@ iperf_tcp_connect(struct iperf_test *test) i_errno = IESETBUF; return -1; } - if (test->settings->socket_bufsize && test->settings->socket_bufsize != opt) { + if (test->debug) { + printf("SNDBUF is %u, expecting %u\n", opt, test->settings->socket_bufsize); + } + if (test->settings->socket_bufsize && test->settings->socket_bufsize > opt) { i_errno = IESETBUF2; return -1; } - if (test->debug) { - printf("SO_SNDBUF is %u\n", opt); - } /* Read back and verify the receiver socket buffer size */ optlen = sizeof(opt); @@ -444,13 +444,13 @@ iperf_tcp_connect(struct iperf_test *test) i_errno = IESETBUF; return -1; } - if (test->settings->socket_bufsize && test->settings->socket_bufsize != opt) { + if (test->debug) { + printf("RCVBUF is %u, expecting %u\n", opt, test->settings->socket_bufsize); + } + if (test->settings->socket_bufsize && test->settings->socket_bufsize > opt) { i_errno = IESETBUF2; return -1; } - if (test->debug) { - printf("SO_RCVBUF is %u\n", opt); - } #if defined(HAVE_FLOWLABEL) if (test->settings->flowlabel) { diff --git a/src/iperf_udp.c b/src/iperf_udp.c index 03b94d7..c92be55 100644 --- a/src/iperf_udp.c +++ b/src/iperf_udp.c @@ -252,13 +252,13 @@ iperf_udp_accept(struct iperf_test *test) i_errno = IESETBUF; return -1; } - if (test->settings->socket_bufsize && test->settings->socket_bufsize != opt) { + if (test->debug) { + printf("SNDBUF is %u, expecting %u\n", opt, test->settings->socket_bufsize); + } + if (test->settings->socket_bufsize && test->settings->socket_bufsize > opt) { i_errno = IESETBUF2; return -1; } - if (test->debug) { - printf("SO_SNDBUF is %u\n", opt); - } /* Read back and verify the receiver socket buffer size */ optlen = sizeof(opt); @@ -266,13 +266,13 @@ iperf_udp_accept(struct iperf_test *test) i_errno = IESETBUF; return -1; } - if (test->settings->socket_bufsize && test->settings->socket_bufsize != opt) { + if (test->debug) { + printf("RCVBUF is %u, expecting %u\n", opt, test->settings->socket_bufsize); + } + if (test->settings->socket_bufsize && test->settings->socket_bufsize > opt) { i_errno = IESETBUF2; return -1; } - if (test->debug) { - printf("SO_RCVBUF is %u\n", opt); - } #if defined(HAVE_SO_MAX_PACING_RATE) /* If socket pacing is available and not disabled, try it. */ @@ -388,13 +388,13 @@ iperf_udp_connect(struct iperf_test *test) i_errno = IESETBUF; return -1; } - if (test->settings->socket_bufsize && test->settings->socket_bufsize != opt) { + if (test->debug) { + printf("SNDBUF is %u, expecting %u\n", opt, test->settings->socket_bufsize); + } + if (test->settings->socket_bufsize && test->settings->socket_bufsize > opt) { i_errno = IESETBUF2; return -1; } - if (test->debug) { - printf("SO_SNDBUF is %u\n", opt); - } /* Read back and verify the receiver socket buffer size */ optlen = sizeof(opt); @@ -402,13 +402,13 @@ iperf_udp_connect(struct iperf_test *test) i_errno = IESETBUF; return -1; } - if (test->settings->socket_bufsize && test->settings->socket_bufsize != opt) { + if (test->debug) { + printf("RCVBUF is %u, expecting %u\n", opt, test->settings->socket_bufsize); + } + if (test->settings->socket_bufsize && test->settings->socket_bufsize > opt) { i_errno = IESETBUF2; return -1; } - if (test->debug) { - printf("SO_RCVBUF is %u\n", opt); - } #if defined(HAVE_SO_MAX_PACING_RATE) /* If socket pacing is available and not disabled, try it. */ |