use socket_set_ipv6only to bind only to the local v6 socket

This is since we probably will get a v4 adresses a tiny bit later, and
that will fail binding.
This commit is contained in:
Love Hornquist Astrand
2009-09-21 07:59:18 -07:00
parent 3ed38b29c7
commit ff5bd1f6c6

View File

@@ -83,6 +83,7 @@ mini_inetd_addrinfo (struct addrinfo *ai)
if (fds[i] < 0)
continue;
socket_set_reuseaddr (fds[i], 1);
socket_set_ipv6only(fds[i], 1);
if (bind (fds[i], a->ai_addr, a->ai_addrlen) < 0) {
warn ("bind af = %d", a->ai_family);
close(fds[i]);