[PATCH] ws2_32: Fix condition when setting IPV6_V6ONLY in WS_bind().

Roman Pisl rpisl at seznam.cz
Fri Oct 14 15:17:11 CDT 2016


Setting IPV6_V6ONLY should be forced just on non in6addr_any addresses.

Signed-off-by: Roman Pisl <rpisl at seznam.cz>
---
 dlls/ws2_32/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index e8c5130..ff8179b 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -3243,7 +3243,7 @@ int WINAPI WS_bind(SOCKET s, const struct WS_sockaddr* name, int namelen)
 #ifdef IPV6_V6ONLY
                 const struct sockaddr_in6 *in6 = (const struct sockaddr_in6*) &uaddr;
                 if (name->sa_family == WS_AF_INET6 &&
-                    !memcmp(&in6->sin6_addr, &in6addr_any, sizeof(struct in6_addr)))
+                    memcmp(&in6->sin6_addr, &in6addr_any, sizeof(struct in6_addr)) != 0)
                 {
                     int enable = 1;
                     if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &enable, sizeof(enable)) == -1)
-- 
2.7.4




More information about the wine-patches mailing list