socket-util: getaddrinfo return values for Windows.
authorGurucharan Shetty <gshetty@nicira.com>
Tue, 18 Feb 2014 17:26:27 +0000 (09:26 -0800)
committerGurucharan Shetty <gshetty@nicira.com>
Fri, 21 Feb 2014 15:58:18 +0000 (07:58 -0800)
Couple of return values need changes.
* EAI_NODATA is the same as EAI_NONAME. So we prevent duplicate cases.
* Windows does not have a EAI_SYSTEM.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/socket-util.c

index c76b116..a30408a 100644 (file)
@@ -243,13 +243,15 @@ lookup_hostname(const char *host_name, struct in_addr *addr)
     case EAI_MEMORY:
         return ENOMEM;
 
-#ifdef EAI_NODATA
+#if defined (EAI_NODATA) && EAI_NODATA != EAI_NONAME
     case EAI_NODATA:
         return ENXIO;
 #endif
 
+#ifdef EAI_SYSTEM
     case EAI_SYSTEM:
         return sock_errno();
+#endif
 
     default:
         return EPROTO;