IPv6: bind IPv4 and IPv6 interfaces by default.

This commit is contained in:
antirez
2013-07-09 10:47:17 +02:00
parent b5423b099c
commit 2e75d3947c
2 changed files with 13 additions and 2 deletions

View File

@ -392,7 +392,7 @@ static int _anetTcpServer(char *err, int port, char *bindaddr, int af)
if ((s = socket(p->ai_family,p->ai_socktype,p->ai_protocol)) == -1)
continue;
if (AF_INET6 == af && anetV6Only(err,s) == ANET_ERR)
if (af == AF_INET6 && anetV6Only(err,s) == ANET_ERR)
goto error; /* could continue here? */
if (anetListen(err,s,p->ai_addr,p->ai_addrlen) == ANET_ERR)