src: Fix looking up a fqdn with getaddrinfo().
authorAndreas Schneider <asn@samba.org>
Tue, 18 Mar 2014 07:43:21 +0000 (08:43 +0100)
committerAndreas Schneider <asn@samba.org>
Wed, 19 Mar 2014 10:12:40 +0000 (11:12 +0100)
This fixes 'getent ahostsv6'.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
src/nss_wrapper.c

index 2706196083f6fbc051a63c263a68c7f18a86097a..d70dfb6b36d860d4d2ee04db04110ae921aa105c 100644 (file)
@@ -3948,7 +3948,7 @@ static int nwrap_getaddrinfo(const char *node,
                }
 #endif
        } else {
-               he = nwrap_files_gethostbyname(node, AF_UNSPEC);
+               he = nwrap_files_gethostbyname(node, hints->ai_family);
                if (he != NULL) {
                        rc = nwrap_convert_he_ai(he, port, hints, &ai);
                        eai = rc;