From 679f2b6acf543950bc657a981ee4696daa10a718 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 29 Nov 2015 17:48:57 +0100
Subject: ws2_32: Ignore socket type for protocol IPPROTO_IPV6 in getaddrinfo.

---
 dlls/ws2_32/socket.c     | 6 ++++++
 dlls/ws2_32/tests/sock.c | 1 +
 2 files changed, 7 insertions(+)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index d31f0b4..342aa07 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -6358,6 +6358,12 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
 
         else if (IS_IPX_PROTO(punixhints->ai_protocol) && punixhints->ai_socktype != SOCK_DGRAM)
             punixhints->ai_socktype = 0;
+
+        else if (punixhints->ai_protocol == IPPROTO_IPV6)
+        {
+            punixhints->ai_family = AF_INET6;
+            punixhints->ai_protocol = 0;
+        }
     }
 
     /* getaddrinfo(3) is thread safe, no need to wrap in CS */
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 00fac77..bffc6b9 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -192,6 +192,7 @@ static const struct addr_hint_tests
     {AF_UNSPEC, SOCK_STREAM, 999,         0 },
     {AF_INET,   SOCK_DGRAM,  999,         0 },
     {AF_INET,   SOCK_DGRAM,  999,         0 },
+    {AF_UNSPEC, SOCK_STREAM, IPPROTO_IPV6,0 },
 };
 
 /**************** Static variables ***************/
-- 
2.6.2

