iperf3: update to 3.14 (#9648)

This commit is contained in:
davidkaroly
2023-10-19 08:02:28 +02:00
committed by GitHub
parent d2ca1b02d0
commit 16dace3ebb
3 changed files with 79 additions and 27 deletions

View File

@@ -7,7 +7,7 @@ through Lawrence Berkeley National Laboratory"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://downloads.es.net/pub/iperf/iperf-$portVersion.tar.gz"
CHECKSUM_SHA256="bee427aeb13d6a2ee22073f23261f63712d82befaa83ac8cb4db5da4c2bdc865"
CHECKSUM_SHA256="723fcc430a027bc6952628fa2a3ac77584a1d0bd328275e573fc9b206c155004"
SOURCE_DIR="iperf-$portVersion"
PATCHES="iperf3-$portVersion.patchset"

View File

@@ -1,14 +1,14 @@
From 5307854dae34c990b5ee2ab85848e392acd285d2 Mon Sep 17 00:00:00 2001
From 01120a55b0b016960048c1c5a2328b4b7e9d5488 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Sun, 2 Oct 2022 19:42:19 +0000
Subject: gcc2 patch
diff --git a/src/iperf_api.c b/src/iperf_api.c
index efd3082..ce6f3d8 100644
index 7c8aea6..22a1d49 100644
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -2369,6 +2369,8 @@ send_results(struct iperf_test *test)
@@ -2377,6 +2377,8 @@ send_results(struct iperf_test *test)
cJSON_AddItemReferenceToObject(j, "server_output_json", test->json_top);
}
else {
@@ -17,7 +17,7 @@ index efd3082..ce6f3d8 100644
/* Add textual output */
size_t buflen = 0;
@@ -2379,7 +2381,7 @@ send_results(struct iperf_test *test)
@@ -2387,7 +2389,7 @@ send_results(struct iperf_test *test)
}
/* Allocate and build it up from the component lines */
@@ -26,7 +26,7 @@ index efd3082..ce6f3d8 100644
TAILQ_FOREACH(t, &(test->server_output_list), textlineentries) {
strncat(output, t->line, buflen);
buflen -= strlen(t->line);
@@ -2909,6 +2911,7 @@ iperf_free_test(struct iperf_test *test)
@@ -2956,6 +2958,7 @@ iperf_free_test(struct iperf_test *test)
{
struct protocol *prot;
struct iperf_stream *sp;
@@ -34,7 +34,7 @@ index efd3082..ce6f3d8 100644
/* Free streams */
while (!SLIST_EMPTY(&test->streams)) {
@@ -3003,7 +3006,6 @@ iperf_free_test(struct iperf_test *test)
@@ -3050,7 +3053,6 @@ iperf_free_test(struct iperf_test *test)
}
/* Free output line buffers, if any (on the server only) */
@@ -42,7 +42,7 @@ index efd3082..ce6f3d8 100644
while (!TAILQ_EMPTY(&test->server_output_list)) {
t = TAILQ_FIRST(&test->server_output_list);
TAILQ_REMOVE(&test->server_output_list, t, textlineentries);
@@ -3039,6 +3041,7 @@ void
@@ -3086,6 +3088,7 @@ void
iperf_reset_test(struct iperf_test *test)
{
struct iperf_stream *sp;
@@ -50,7 +50,7 @@ index efd3082..ce6f3d8 100644
int i;
iperf_close_logfile(test);
@@ -3152,7 +3155,6 @@ iperf_reset_test(struct iperf_test *test)
@@ -3199,7 +3202,6 @@ iperf_reset_test(struct iperf_test *test)
}
/* Free output line buffers, if any (on the server only) */
@@ -58,7 +58,7 @@ index efd3082..ce6f3d8 100644
while (!TAILQ_EMPTY(&test->server_output_list)) {
t = TAILQ_FIRST(&test->server_output_list);
TAILQ_REMOVE(&test->server_output_list, t, textlineentries);
@@ -3323,8 +3325,9 @@ iperf_print_intermediate(struct iperf_test *test)
@@ -3370,8 +3372,9 @@ iperf_print_intermediate(struct iperf_test *test)
SLIST_FOREACH(sp, &test->streams, streams) {
irp = TAILQ_LAST(&sp->result->interval_results, irlisthead);
if (irp) {
@@ -69,28 +69,28 @@ index efd3082..ce6f3d8 100644
if (test->debug) {
printf("interval_len %f bytes_transferred %" PRIu64 "\n", interval_len, irp->bytes_transferred);
}
@@ -4671,6 +4674,7 @@ iperf_json_start(struct iperf_test *test)
@@ -4736,6 +4739,7 @@ iperf_json_start(struct iperf_test *test)
int
iperf_json_finish(struct iperf_test *test)
{
+ char *str;
if (test->title)
cJSON_AddStringToObject(test->json_top, "title", test->title);
if (test->extra_data)
@@ -4685,7 +4689,7 @@ iperf_json_finish(struct iperf_test *test)
// Get ASCII rendering of JSON structure. Then make our
// own copy of it and return the storage that cJSON allocated
// on our behalf. We keep our own copy around.
- char *str = cJSON_Print(test->json_top);
+ str = cJSON_Print(test->json_top);
if (str == NULL)
return -1;
test->json_output_string = strdup(str);
if (test->json_top) {
if (test->title) {
cJSON_AddStringToObject(test->json_top, "title", test->title);
@@ -4753,7 +4757,7 @@ iperf_json_finish(struct iperf_test *test)
// Get ASCII rendering of JSON structure. Then make our
// own copy of it and return the storage that cJSON allocated
// on our behalf. We keep our own copy around.
- char *str = cJSON_Print(test->json_top);
+ str = cJSON_Print(test->json_top);
if (str == NULL) {
return -1;
}
diff --git a/src/iperf_auth.c b/src/iperf_auth.c
index 867c55f..21e575d 100644
index 595f730..58dfcfb 100644
--- a/src/iperf_auth.c
+++ b/src/iperf_auth.c
@@ -357,6 +357,8 @@ int decode_auth_setting(int enable_debug, const char *authtoken, EVP_PKEY *priva
@@ -359,6 +359,8 @@ int decode_auth_setting(int enable_debug, const char *authtoken, EVP_PKEY *priva
ssize_t iperf_getpass (char **lineptr, size_t *n, FILE *stream) {
struct termios old, new;
ssize_t nread;
@@ -99,7 +99,7 @@ index 867c55f..21e575d 100644
/* Turn echoing off and fail if we can't. */
if (tcgetattr (fileno (stream), &old) != 0)
@@ -374,8 +376,7 @@ ssize_t iperf_getpass (char **lineptr, size_t *n, FILE *stream) {
@@ -376,8 +378,7 @@ ssize_t iperf_getpass (char **lineptr, size_t *n, FILE *stream) {
(void) tcsetattr (fileno (stream), TCSAFLUSH, &old);
//strip the \n or \r\n chars
@@ -110,7 +110,7 @@ index 867c55f..21e575d 100644
if (buf[i] == '\n' || buf[i] == '\r'){
buf[i] = '\0';
diff --git a/src/iperf_client_api.c b/src/iperf_client_api.c
index fbe1a61..c505f6a 100644
index fb4aff4..09595d6 100644
--- a/src/iperf_client_api.c
+++ b/src/iperf_client_api.c
@@ -54,18 +54,19 @@
@@ -238,6 +238,58 @@ index 919bedd..fdb3e10 100644
if (test->settings->bitrate_limit > 0 && total_requested_rate > test->settings->bitrate_limit) {
if (iperf_get_verbose(test))
iperf_err(test, "Client total requested throughput rate of %" PRIu64 " bps exceeded %" PRIu64 " bps limit",
diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c
index e289284..f4bfadb 100644
--- a/src/iperf_tcp.c
+++ b/src/iperf_tcp.c
@@ -471,17 +471,19 @@ iperf_tcp_connect(struct iperf_test *test)
}
if (test->json_output) {
+ cJSON *sndbuf_actual_item;
+ cJSON *rcvbuf_actual_item;
cJSON *sock_bufsize_item = cJSON_GetObjectItem(test->json_start, "sock_bufsize");
if (sock_bufsize_item == NULL) {
cJSON_AddNumberToObject(test->json_start, "sock_bufsize", test->settings->socket_bufsize);
}
- cJSON *sndbuf_actual_item = cJSON_GetObjectItem(test->json_start, "sndbuf_actual");
+ sndbuf_actual_item = cJSON_GetObjectItem(test->json_start, "sndbuf_actual");
if (sndbuf_actual_item == NULL) {
cJSON_AddNumberToObject(test->json_start, "sndbuf_actual", sndbuf_actual);
}
- cJSON *rcvbuf_actual_item = cJSON_GetObjectItem(test->json_start, "rcvbuf_actual");
+ rcvbuf_actual_item = cJSON_GetObjectItem(test->json_start, "rcvbuf_actual");
if (rcvbuf_actual_item == NULL) {
cJSON_AddNumberToObject(test->json_start, "rcvbuf_actual", rcvbuf_actual);
}
diff --git a/src/iperf_udp.c b/src/iperf_udp.c
index fca3a1b..12af75b 100644
--- a/src/iperf_udp.c
+++ b/src/iperf_udp.c
@@ -348,17 +348,19 @@ iperf_udp_buffercheck(struct iperf_test *test, int s)
}
if (test->json_output) {
+ cJSON *sndbuf_actual_item;
+ cJSON *rcvbuf_actual_item;
cJSON *sock_bufsize_item = cJSON_GetObjectItem(test->json_start, "sock_bufsize");
if (sock_bufsize_item == NULL) {
cJSON_AddNumberToObject(test->json_start, "sock_bufsize", test->settings->socket_bufsize);
}
- cJSON *sndbuf_actual_item = cJSON_GetObjectItem(test->json_start, "sndbuf_actual");
+ sndbuf_actual_item = cJSON_GetObjectItem(test->json_start, "sndbuf_actual");
if (sndbuf_actual_item == NULL) {
cJSON_AddNumberToObject(test->json_start, "sndbuf_actual", sndbuf_actual);
}
- cJSON *rcvbuf_actual_item = cJSON_GetObjectItem(test->json_start, "rcvbuf_actual");
+ rcvbuf_actual_item = cJSON_GetObjectItem(test->json_start, "rcvbuf_actual");
if (rcvbuf_actual_item == NULL) {
cJSON_AddNumberToObject(test->json_start, "rcvbuf_actual", rcvbuf_actual);
}
diff --git a/src/t_api.c b/src/t_api.c
index d822f55..9f13a84 100644
--- a/src/t_api.c