last round of Linux IPv6 fixes

svn: r1388
This commit is contained in:
Matthew Flatt 2005-11-23 21:06:08 +00:00
parent 763f164580
commit 06c60a7f18

View File

@ -1838,6 +1838,11 @@ tcp_listen(int argc, Scheme_Object *argv[])
if ((v6_loop && (addr->ai_family != PF_INET6)) if ((v6_loop && (addr->ai_family != PF_INET6))
|| (skip_v6 && (addr->ai_family == PF_INET6))) { || (skip_v6 && (addr->ai_family == PF_INET6))) {
addr = addr->ai_next; addr = addr->ai_next;
if (v6_loop && !addr) {
v6_loop = 0;
skip_v6 = 1;
addr = tcp_listen_addr;
}
continue; continue;
} }
#endif #endif
@ -1865,11 +1870,18 @@ tcp_listen(int argc, Scheme_Object *argv[])
# else # else
ok = -1; ok = -1;
# endif # endif
if (ok && !pos) { if (ok) {
/* IPV6_V6ONLY doesn't work */ if (!pos) {
no_ipv6 = 1; /* IPV6_V6ONLY doesn't work */
freeaddrinfo(tcp_listen_addr); no_ipv6 = 1;
goto retry; freeaddrinfo(tcp_listen_addr);
goto retry;
} else {
errid = errno;
closesocket(s);
errno = errid;
s = INVALID_SOCKET;
}
} }
} }
} }