qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL
@ 2020-09-08 12:15 Thomas Huth
  2020-09-09  9:57 ` Daniel P. Berrangé
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2020-09-08 12:15 UTC (permalink / raw)
  To: qemu-devel, Daniel P . Berrange, Marc-André Lureau

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: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/socket-helpers.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/socket-helpers.c b/tests/socket-helpers.c
index 19a51e887e..f704fd1a69 100644
--- a/tests/socket-helpers.c
+++ b/tests/socket-helpers.c
@@ -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;
-- 
2.18.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL
  2020-09-08 12:15 [PATCH] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL Thomas Huth
@ 2020-09-09  9:57 ` Daniel P. Berrangé
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2020-09-09  9:57 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Marc-André Lureau, qemu-devel

On Tue, Sep 08, 2020 at 02:15:43PM +0200, Thomas Huth wrote:
> 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: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/socket-helpers.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-09 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08 12:15 [PATCH] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL Thomas Huth
2020-09-09  9:57 ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).