From d6a675174651c429809aaa850e6b01c12c3dd931 Mon Sep 17 00:00:00 2001 From: "Bruce A. Mah" Date: Mon, 18 Sep 2017 15:17:18 -0700 Subject: [PATCH] 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. --- src/iperf_client_api.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/iperf_client_api.c b/src/iperf_client_api.c index 70f985f..4ac30a6 100644 --- a/src/iperf_client_api.c +++ b/src/iperf_client_api.c @@ -382,10 +382,11 @@ iperf_connect(struct iperf_test *test) * Regardless of whether explicitly or implicitly set, if the * block size is larger than the MSS, print a warning. */ - if (test->settings->blksize > test->ctrl_sck_mss) { + if (test->settings->blksize > test->ctrl_sck_mss && + test->ctrl_sck_mss > 0) { char str[128]; snprintf(str, sizeof(str), - "Warning: UDP block size %d exceeds TCP MSS %d, may result in fragmentation / drops", test->settings->blksize, test->ctrl_sck_mss); + "UDP block size %d exceeds TCP MSS %d, may result in fragmentation / drops", test->settings->blksize, test->ctrl_sck_mss); warning(str); } }