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 #604.
(cherry picked from commit d6a675174651c429809aaa850e6b01c12c3dd931)
Signed-off-by: Bruce A. Mah <bmah@es.net>
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 @@
* 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);
}
}