1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-20 04:28:07 -05:00

sk_namelookup() on Unix was failing to translate from our platform-

independent ADDRTYPE_* constants to real AF_* ones, causing explicit
protocol specification to fail.

[originally from svn r5089]
This commit is contained in:
Simon Tatham 2005-01-09 14:55:55 +00:00
parent ea218e4d2c
commit 378dbbb06b

View File

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