Dmitry Timoshkov : iphlpapi: Also check the IP address family before treating it as an IPv6 one.

Alexandre Julliard julliard at winehq.org
Tue Feb 20 16:44:52 CST 2018


Module: wine
Branch: master
Commit: b4d0e56c93f66bcea48cdd79311568047727d1fa
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b4d0e56c93f66bcea48cdd79311568047727d1fa

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Feb 20 14:40:21 2018 +0800

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 <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 48a8387..97284ed 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] );




More information about the wine-cvs mailing list