Module: wine Branch: master Commit: ea18c740f79a6ad7e96f3655b5927ac496e5cb49 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ea18c740f79a6ad7e96f3655b5...
Author: Michael Müller michael@fds-team.de Date: Mon Apr 25 22:12:21 2016 +0200
ws2_32: Fix getaddrinfo with IPPROTO_IPV6 protocol.
Signed-off-by: Michael Müller michael@fds-team.de Signed-off-by: Sebastian Lackner sebastian@fds-team.de Signed-off-by: Bruno Jesus 00cpxxx@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ws2_32/socket.c | 3 +++ dlls/ws2_32/tests/sock.c | 8 ++++++++ 2 files changed, 11 insertions(+)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 8d58631..a2e6912 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -6471,6 +6471,9 @@ 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_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 00555a9..9e0c2f9 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -170,24 +170,32 @@ static const struct addr_hint_tests } hinttests[] = { {AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, 0 }, {AF_UNSPEC, SOCK_STREAM, IPPROTO_UDP, 0 }, + {AF_UNSPEC, SOCK_STREAM, IPPROTO_IPV6,0 }, {AF_UNSPEC, SOCK_DGRAM, IPPROTO_TCP, 0 }, {AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, 0 }, + {AF_UNSPEC, SOCK_DGRAM, IPPROTO_IPV6,0 }, {AF_INET, SOCK_STREAM, IPPROTO_TCP, 0 }, {AF_INET, SOCK_STREAM, IPPROTO_UDP, 0 }, + {AF_INET, SOCK_STREAM, IPPROTO_IPV6,0 }, {AF_INET, SOCK_DGRAM, IPPROTO_TCP, 0 }, {AF_INET, SOCK_DGRAM, IPPROTO_UDP, 0 }, + {AF_INET, SOCK_DGRAM, IPPROTO_IPV6,0 }, {AF_UNSPEC, 0, IPPROTO_TCP, 0 }, {AF_UNSPEC, 0, IPPROTO_UDP, 0 }, + {AF_UNSPEC, 0, IPPROTO_IPV6,0 }, {AF_UNSPEC, SOCK_STREAM, 0, 0 }, {AF_UNSPEC, SOCK_DGRAM, 0, 0 }, {AF_INET, 0, IPPROTO_TCP, 0 }, {AF_INET, 0, IPPROTO_UDP, 0 }, + {AF_INET, 0, IPPROTO_IPV6,0 }, {AF_INET, SOCK_STREAM, 0, 0 }, {AF_INET, SOCK_DGRAM, 0, 0 }, {AF_UNSPEC, 999, IPPROTO_TCP, WSAESOCKTNOSUPPORT }, {AF_UNSPEC, 999, IPPROTO_UDP, WSAESOCKTNOSUPPORT }, + {AF_UNSPEC, 999, IPPROTO_IPV6,WSAESOCKTNOSUPPORT }, {AF_INET, 999, IPPROTO_TCP, WSAESOCKTNOSUPPORT }, {AF_INET, 999, IPPROTO_UDP, WSAESOCKTNOSUPPORT }, + {AF_INET, 999, IPPROTO_IPV6,WSAESOCKTNOSUPPORT }, {AF_UNSPEC, SOCK_STREAM, 999, 0 }, {AF_UNSPEC, SOCK_STREAM, 999, 0 }, {AF_INET, SOCK_DGRAM, 999, 0 },