Commit b4d0e56c authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent acc44e5d
......@@ -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] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment