support ipv6

This commit is contained in:
Love Hörnquist Åstrand
2012-03-07 07:58:25 -08:00
parent 92b243a638
commit d791e70894
3 changed files with 24 additions and 46 deletions

View File

@@ -162,6 +162,9 @@ client_doit (const char *hostname, int port, const char *service,
s = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
if (s < 0)
continue;
socket_set_ipv6only(s, 1);
if (connect (s, a->ai_addr, a->ai_addrlen) < 0) {
warn ("connect(%s)", hostname);
close (s);