--- embedaddon/iperf/src/iperf_util.c 2021/03/17 00:36:46 1.1.1.2 +++ embedaddon/iperf/src/iperf_util.c 2023/09/27 11:14:54 1.1.1.3 @@ -128,7 +128,7 @@ make_cookie(const char *cookie) /* is_closed * * Test if the file descriptor fd is closed. - * + * * Iperf uses this function to test whether a TCP stream socket * is closed, because accepting and denying an invalid connection * in iperf_tcp_accept is not considered an error. @@ -176,7 +176,7 @@ double timeval_diff(struct timeval * tv0, struct timeval * tv1) { double time1, time2; - + time1 = tv0->tv_sec + (tv0->tv_usec / 1000000.0); time2 = tv1->tv_sec + (tv1->tv_usec / 1000000.0); @@ -232,7 +232,7 @@ get_system_info(void) memset(buf, 0, 1024); uname(&uts); - snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename, + snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename, uts.release, uts.version, uts.machine); return buf; @@ -249,44 +249,44 @@ get_optional_features(void) #if defined(HAVE_CPU_AFFINITY) if (numfeatures > 0) { - strncat(features, ", ", + strncat(features, ", ", sizeof(features) - strlen(features) - 1); } - strncat(features, "CPU affinity setting", + strncat(features, "CPU affinity setting", sizeof(features) - strlen(features) - 1); numfeatures++; #endif /* HAVE_CPU_AFFINITY */ - + #if defined(HAVE_FLOWLABEL) if (numfeatures > 0) { - strncat(features, ", ", + strncat(features, ", ", sizeof(features) - strlen(features) - 1); } - strncat(features, "IPv6 flow label", + strncat(features, "IPv6 flow label", sizeof(features) - strlen(features) - 1); numfeatures++; #endif /* HAVE_FLOWLABEL */ - + #if defined(HAVE_SCTP_H) if (numfeatures > 0) { - strncat(features, ", ", + strncat(features, ", ", sizeof(features) - strlen(features) - 1); } - strncat(features, "SCTP", + strncat(features, "SCTP", sizeof(features) - strlen(features) - 1); numfeatures++; #endif /* HAVE_SCTP_H */ - + #if defined(HAVE_TCP_CONGESTION) if (numfeatures > 0) { - strncat(features, ", ", + strncat(features, ", ", sizeof(features) - strlen(features) - 1); } - strncat(features, "TCP congestion algorithm setting", + strncat(features, "TCP congestion algorithm setting", sizeof(features) - strlen(features) - 1); numfeatures++; #endif /* HAVE_TCP_CONGESTION */ - + #if defined(HAVE_SENDFILE) if (numfeatures > 0) { strncat(features, ", ", @@ -317,8 +317,28 @@ get_optional_features(void) numfeatures++; #endif /* HAVE_SSL */ +#if defined(HAVE_SO_BINDTODEVICE) + if (numfeatures > 0) { + strncat(features, ", ", + sizeof(features) - strlen(features) - 1); + } + strncat(features, "bind to device", + sizeof(features) - strlen(features) - 1); + numfeatures++; +#endif /* HAVE_SO_BINDTODEVICE */ + +#if defined(HAVE_DONT_FRAGMENT) + if (numfeatures > 0) { + strncat(features, ", ", + sizeof(features) - strlen(features) - 1); + } + strncat(features, "support IPv4 don't fragment", + sizeof(features) - strlen(features) - 1); + numfeatures++; +#endif /* HAVE_DONT_FRAGMENT */ + if (numfeatures == 0) { - strncat(features, "None", + strncat(features, "None", sizeof(features) - strlen(features) - 1); } @@ -456,8 +476,8 @@ int daemon(int nochdir, int noclose) /* * Fork again to avoid becoming a session leader. - * This might only matter on old SVr4-derived OSs. - * Note in particular that glibc and FreeBSD libc + * This might only matter on old SVr4-derived OSs. + * Note in particular that glibc and FreeBSD libc * only fork once. */ pid = fork();