diff --git a/src/socket.c b/src/socket.c index 4979f09..e17b95a 100644 --- a/src/socket.c +++ b/src/socket.c @@ -800,6 +800,11 @@ static struct socket *tcpx_listen(Slirp *slirp, int family, } s = slirp_socket(family, SOCK_STREAM, 0); + + int v = 1; + if (family == AF_INET6) { + setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &v, sizeof(v)); + } if ((s < 0) || (slirp_socket_set_fast_reuse(s) < 0) || (bind(s, (struct sockaddr *)&addr, addrlen) < 0) ||