diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-04-04 01:31:51 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-04-04 01:31:51 -0700 |
commit | 2ed8b31a1133d4e25b78dce44f5f1c95abbc4e7a (patch) | |
tree | 144cdc1bab0e55eb2f6751a399ffdedad7a879fe /common/os_calls.c | |
parent | a1ca4156158111ced62a3bb6968dc49bf7665bd0 (diff) | |
download | xrdp-proprietary-2ed8b31a1133d4e25b78dce44f5f1c95abbc4e7a.tar.gz xrdp-proprietary-2ed8b31a1133d4e25b78dce44f5f1c95abbc4e7a.zip |
ipv6
Diffstat (limited to 'common/os_calls.c')
-rw-r--r-- | common/os_calls.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index ea122552..af54facf 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -542,16 +542,24 @@ g_tcp_connect(int sck, const char *address, const char *port) * available IPv4-mapped addresses in case the target * host does not have a true IPv6 address: */ + p.ai_socktype = SOCK_STREAM; + p.ai_protocol = IPPROTO_TCP; #if !defined(NO_ARPA_INET_H_IP6) p.ai_flags = AI_ADDRCONFIG | AI_V4MAPPED; p.ai_family = AF_INET6; + if (g_strcmp(address, "127.0.0.1") == 0) + { + res = getaddrinfo("::1", port, &p, &h); + } + else + { + res = getaddrinfo(address, port, &p, &h); + } #else p.ai_flags = AI_ADDRCONFIG; p.ai_family = AF_INET; -#endif - p.ai_socktype = SOCK_STREAM; - p.ai_protocol = IPPROTO_TCP; res = getaddrinfo(address, port, &p, &h); +#endif if (res > -1) { if (h != NULL) |