nwrap: fix return code of getaddrinfo for AI_NUMERICSERV in error case
authorMichael Adam <obnox@samba.org>
Fri, 6 Nov 2015 09:45:15 +0000 (10:45 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 11 Jan 2016 11:25:28 +0000 (12:25 +0100)
If the AI_NUMERICSERV flag is specified, the the port number
has to specified as a string representing a decimal number
or left NULL.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/nss_wrapper/nss_wrapper.c

index 5fd3d7b7087e4efea3d13f9b52c812bc831c15b2..9404d173d726d7d1da47c30402efba6f5ed551dc 100644 (file)
@@ -5089,7 +5089,7 @@ static int nwrap_getaddrinfo(const char *node,
                        port = sl;
                        goto valid_port;
                } else if (hints->ai_flags & AI_NUMERICSERV) {
-                       return EAI_SERVICE;
+                       return EAI_NONAME;
                }
 
                if (hints->ai_protocol != 0) {