Commit e106ff30 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Try to use dual-stack when needed, and warn user if it failed.

parent d17cf7bf
......@@ -252,6 +252,19 @@ int net_ListenSingle (vlc_object_t *obj, const char *host, int port,
int fd = fdv[0];
assert (fd != -1);
if (fdv[1] != -1)
{
#ifdef IPV6_V6ONLY
struct sockaddr_storage addr;
getsockname (fd, (struct sockaddr *)&addr,
&(socklen_t){ sizeof (addr) });
if ((addr.ss_family == AF_INET6)
&& setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &(int){ 0 },
sizeof (int)))
#endif
msg_Err (obj, "Lame IP dual-stack: IPv4 connections might fail.");
}
free (fdv);
return fd;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment