--- embedaddon/iperf/src/iperf_error.c 2021/03/17 00:36:46 1.1.1.2 +++ embedaddon/iperf/src/iperf_error.c 2023/09/27 11:14:54 1.1.1.3 @@ -1,5 +1,5 @@ /* - * iperf, Copyright (c) 2014-2020, The Regents of the University of + * iperf, Copyright (c) 2014-2022, The Regents of the University of * California, through Lawrence Berkeley National Laboratory (subject * to receipt of any required approvals from the U.S. Dept. of * Energy). All rights reserved. @@ -59,7 +59,7 @@ iperf_err(struct iperf_test *test, const char *format, vsnprintf(str, sizeof(str), format, argp); if (test != NULL && test->json_output && test->json_top != NULL) cJSON_AddStringToObject(test->json_top, "error", str); - else + else { if (test && test->outfile && test->outfile != stdout) { if (ct) { fprintf(test->outfile, "%s", ct); @@ -72,6 +72,7 @@ iperf_err(struct iperf_test *test, const char *format, } fprintf(stderr, "iperf3: %s\n", str); } + } va_end(argp); } @@ -95,8 +96,10 @@ iperf_errexit(struct iperf_test *test, const char *for va_start(argp, format); vsnprintf(str, sizeof(str), format, argp); - if (test != NULL && test->json_output && test->json_top != NULL) { - cJSON_AddStringToObject(test->json_top, "error", str); + if (test != NULL && test->json_output) { + if (test->json_top != NULL) { + cJSON_AddStringToObject(test->json_top, "error", str); + } iperf_json_finish(test); } else if (test && test->outfile && test->outfile != stdout) { @@ -227,7 +230,7 @@ iperf_strerror(int int_errno) perr = 1; break; case IECONNECT: - snprintf(errstr, len, "unable to connect to server"); + snprintf(errstr, len, "unable to connect to server - server may have stopped running or use a different port, firewall issue, etc."); perr = 1; herr = 1; break; @@ -256,14 +259,14 @@ iperf_strerror(int int_errno) snprintf(errstr, len, "control socket has closed unexpectedly"); break; case IEMESSAGE: - snprintf(errstr, len, "received an unknown control message"); + snprintf(errstr, len, "received an unknown control message (ensure other side is iperf3 and not iperf)"); break; case IESENDMESSAGE: - snprintf(errstr, len, "unable to send control message"); + snprintf(errstr, len, "unable to send control message - port may not be available, the other side may have stopped running, etc."); perr = 1; break; case IERECVMESSAGE: - snprintf(errstr, len, "unable to receive control message"); + snprintf(errstr, len, "unable to receive control message - port may not be available, the other side may have stopped running, etc."); perr = 1; break; case IESENDPARAMS: @@ -341,6 +344,21 @@ iperf_strerror(int int_errno) snprintf(errstr, len, "unable to set CPU affinity"); perr = 1; break; + case IERCVTIMEOUT: + snprintf(errstr, len, "receive timeout value is incorrect or not in range"); + perr = 1; + break; + case IESNDTIMEOUT: + snprintf(errstr, len, "send timeout value is incorrect or not in range"); + perr = 1; + break; + case IEUDPFILETRANSFER: + snprintf(errstr, len, "cannot transfer file using UDP"); + break; + case IERVRSONLYRCVTIMEOUT: + snprintf(errstr, len, "client receive timeout is valid only in receiving mode"); + perr = 1; + break; case IEDAEMON: snprintf(errstr, len, "unable to become a daemon"); perr = 1; @@ -392,7 +410,7 @@ iperf_strerror(int int_errno) perr = 1; break; case IESETCONGESTION: - snprintf(errstr, len, "unable to set TCP_CONGESTION: " + snprintf(errstr, len, "unable to set TCP_CONGESTION: " "Supplied congestion control algorithm not supported on this host"); break; case IEPIDFILE: @@ -423,6 +441,31 @@ iperf_strerror(int int_errno) break; case IETOTALRATE: snprintf(errstr, len, "total required bandwidth is larger than server limit"); + break; + case IESKEWTHRESHOLD: + snprintf(errstr, len, "skew threshold must be a positive number"); + break; + case IEIDLETIMEOUT: + snprintf(errstr, len, "idle timeout parameter is not positive or larger than allowed limit"); + break; + case IEBINDDEV: + snprintf(errstr, len, "Unable to bind-to-device (check perror, maybe permissions?)"); + break; + case IEBINDDEVNOSUPPORT: + snprintf(errstr, len, "`%%` is not supported as system does not support bind to device"); + break; + case IEHOSTDEV: + snprintf(errstr, len, "host device name (ip%%) is supported (and required) only for IPv6 link-local address"); + break; + case IENOMSG: + snprintf(errstr, len, "idle timeout for receiving data"); + break; + case IESETDONTFRAGMENT: + snprintf(errstr, len, "unable to set IP Do-Not-Fragment flag"); + break; + case IESETUSERTIMEOUT: + snprintf(errstr, len, "unable to set TCP USER_TIMEOUT"); + perr = 1; break; default: snprintf(errstr, len, "int_errno=%d", int_errno);