aboutsummaryrefslogtreecommitdiff
path: root/src/iperf_sctp.c
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@es.net>2019-06-18 16:03:21 -0700
committerGitHub <noreply@github.com>2019-06-18 16:03:21 -0700
commit38bac802fa85db9012981ff87c3725812a3d8a07 (patch)
treea9dca0d615540654f27c8532de4713523ed52b28 /src/iperf_sctp.c
parentc4bd56f3736d362e33be56929d306ccb0d37d0ef (diff)
downloadiperf3-38bac802fa85db9012981ff87c3725812a3d8a07.tar.gz
fix: Emit appropriate error messages from getaddrinfo(3). (#888)
* fix: Emit appropriate error messages from getaddrinfo(3). This fixes an omission likely caused when switching resolver library calls. Fixes #846.
Diffstat (limited to 'src/iperf_sctp.c')
-rw-r--r--src/iperf_sctp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/iperf_sctp.c b/src/iperf_sctp.c
index c1cb134..06e1e23 100644
--- a/src/iperf_sctp.c
+++ b/src/iperf_sctp.c
@@ -1,5 +1,5 @@
/*
- * iperf, Copyright (c) 2014-2018, The Regents of the University of
+ * iperf, Copyright (c) 2014-2019, 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.
@@ -178,7 +178,7 @@ iperf_sctp_listen(struct iperf_test *test)
}
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
- if (getaddrinfo(test->bind_address, portstr, &hints, &res) != 0) {
+ if ((gerror = getaddrinfo(test->bind_address, portstr, &hints, &res)) != 0) {
i_errno = IESTREAMLISTEN;
return -1;
}
@@ -266,7 +266,7 @@ iperf_sctp_connect(struct iperf_test *test)
memset(&hints, 0, sizeof(hints));
hints.ai_family = test->settings->domain;
hints.ai_socktype = SOCK_STREAM;
- if (getaddrinfo(test->bind_address, NULL, &hints, &local_res) != 0) {
+ if ((gerror = getaddrinfo(test->bind_address, NULL, &hints, &local_res)) != 0) {
i_errno = IESTREAMCONNECT;
return -1;
}
@@ -276,7 +276,7 @@ iperf_sctp_connect(struct iperf_test *test)
hints.ai_family = test->settings->domain;
hints.ai_socktype = SOCK_STREAM;
snprintf(portstr, sizeof(portstr), "%d", test->server_port);
- if (getaddrinfo(test->server_hostname, portstr, &hints, &server_res) != 0) {
+ if ((gerror = getaddrinfo(test->server_hostname, portstr, &hints, &server_res)) != 0) {
if (test->bind_address)
freeaddrinfo(local_res);
i_errno = IESTREAMCONNECT;
@@ -548,7 +548,7 @@ iperf_sctp_bindx(struct iperf_test *test, int s, int is_server)
xbe0 = TAILQ_FIRST(&test->xbind_addrs);
TAILQ_REMOVE(&test->xbind_addrs, xbe0, link);
- if (getaddrinfo(xbe0->name, servname, &hints, &xbe0->ai) != 0) {
+ if ((gerror = getaddrinfo(xbe0->name, servname, &hints, &xbe0->ai)) != 0) {
i_errno = IESETSCTPBINDX;
retval = -1;
goto out;
@@ -592,7 +592,7 @@ iperf_sctp_bindx(struct iperf_test *test, int s, int is_server)
TAILQ_FOREACH(xbe, &test->xbind_addrs, link) {
if (xbe->ai != NULL)
freeaddrinfo(xbe->ai);
- if (getaddrinfo(xbe->name, servname, &hints, &xbe->ai) != 0) {
+ if ((gerror = getaddrinfo(xbe->name, servname, &hints, &xbe->ai)) != 0) {
i_errno = IESETSCTPBINDX;
retval = -1;
goto out;