mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 15:55:31 +01:00
Merge pull request #10774 from spotlightishere/bsd-determine-nameserver
IP/Top: Expand host nameserver usage
This commit is contained in:
commit
efcb9bec9c
@ -605,6 +605,7 @@ if (APPLE)
|
|||||||
${CORESERV_LIBRARY}
|
${CORESERV_LIBRARY}
|
||||||
${IOB_LIBRARY}
|
${IOB_LIBRARY}
|
||||||
${IOK_LIBRARY}
|
${IOK_LIBRARY}
|
||||||
|
resolv
|
||||||
)
|
)
|
||||||
elseif (ANDROID)
|
elseif (ANDROID)
|
||||||
target_link_libraries(core
|
target_link_libraries(core
|
||||||
|
@ -864,13 +864,27 @@ IPCReply NetIPTopDevice::HandleGetInterfaceOptRequest(const IOCtlVRequest& reque
|
|||||||
FREE(AdapterAddresses);
|
FREE(AdapterAddresses);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(__linux__) && !defined(__ANDROID__)
|
#elif (defined(__linux__) && !defined(ANDROID)) || defined(__APPLE__) || defined(__FreeBSD__) || \
|
||||||
|
defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
|
||||||
if (!Core::WantsDeterminism())
|
if (!Core::WantsDeterminism())
|
||||||
{
|
{
|
||||||
if (res_init() == 0)
|
if (res_init() == 0)
|
||||||
address = ntohl(_res.nsaddr_list[0].sin_addr.s_addr);
|
{
|
||||||
|
for (int i = 0; i < _res.nscount; i++)
|
||||||
|
{
|
||||||
|
// Find the first available IPv4 nameserver.
|
||||||
|
sockaddr_in current = _res.nsaddr_list[i];
|
||||||
|
if (current.sin_family == AF_INET)
|
||||||
|
{
|
||||||
|
address = ntohl(_res.nsaddr_list[i].sin_addr.s_addr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
WARN_LOG_FMT(IOS_NET, "Call to res_init failed");
|
WARN_LOG_FMT(IOS_NET, "Call to res_init failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (address == 0)
|
if (address == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user