From b4d0e56c93f66bcea48cdd79311568047727d1fa Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 20 Feb 2018 14:40:21 +0800 Subject: [PATCH] iphlpapi: Also check the IP address family before treating it as an IPv6 one. On my local network there is no IPv6 DNS servers, and sin6_family == AF_INET. Signed-off-by: Dmitry Timoshkov Signed-off-by: Alexandre Julliard --- dlls/iphlpapi/iphlpapi_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 48a83870a58..97284edbe64 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -1300,7 +1300,7 @@ static int get_dns_servers( SOCKADDR_STORAGE *servers, int num, BOOL ip4_only ) for (i = 0, addr = servers; addr < (servers + num) && i < _res.nscount; i++) { #ifdef HAVE_STRUCT___RES_STATE__U__EXT_NSCOUNT6 - if (_res._u._ext.nsaddrs[i]) + if (_res._u._ext.nsaddrs[i] && _res._u._ext.nsaddrs[i]->sin6_family == AF_INET6) { if (ip4_only) continue; sockaddr_in6_to_WS_storage( addr, _res._u._ext.nsaddrs[i] );