]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
sk_namelookup() on Unix was failing to translate from our platform-
authorSimon Tatham <anakin@pobox.com>
Sun, 9 Jan 2005 14:55:55 +0000 (14:55 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 9 Jan 2005 14:55:55 +0000 (14:55 +0000)
independent ADDRTYPE_* constants to real AF_* ones, causing explicit
protocol specification to fail.

[originally from svn r5089]

unix/uxnet.c

index 13b616b9b9c0e91707f41ddc46ed3275a1292e50..d51d75f0385b25340055414570c23f3e6ad67bdb 100644 (file)
@@ -145,8 +145,10 @@ SockAddr sk_namelookup(const char *host, char **canonicalname, int address_famil
 
 #ifndef NO_IPV6
     hints.ai_flags = AI_CANONNAME;
-    hints.ai_family = address_family;
-    hints.ai_socktype = 0;
+    hints.ai_family = (address_family == ADDRTYPE_IPV4 ? AF_INET :
+                      address_family == ADDRTYPE_IPV6 ? AF_INET6 :
+                      AF_UNSPEC);
+    hints.ai_socktype = SOCK_STREAM;
     hints.ai_protocol = 0;
     hints.ai_addrlen = 0;
     hints.ai_addr = NULL;