Skip to content
Snippets Groups Projects
Commit b822c05b authored by Thomas Huth's avatar Thomas Huth
Browse files

tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL


The tests/test-char test is currently always failing on my system since
the getaddrinfo() in socket_can_bind_connect() returns EAI_NONAME when
it is called from socket_check_protocol_support() to check for IPv6.
socket_check_protocol_support() then returns -1 and thus the tests are
not run at all - even though IPv4 is working fine.
socket_can_bind_connect() connect should return EADDRNOTAVAIL in this
case instead, so that socket_check_protocol_support() does not fail.

Suggested-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200908121543.222872-1-thuth@redhat.com>
Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
parent d97b4b0d
No related branches found
No related tags found
No related merge requests found
......@@ -59,8 +59,7 @@ static int socket_can_bind_connect(const char *hostname, int family)
/* lookup */
rc = getaddrinfo(hostname, NULL, &ai, &res);
if (rc != 0) {
if (rc == EAI_ADDRFAMILY ||
rc == EAI_FAMILY) {
if (rc == EAI_ADDRFAMILY || rc == EAI_FAMILY || rc == EAI_NONAME) {
errno = EADDRNOTAVAIL;
} else {
errno = EINVAL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment