mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Added warning log for testing purpose on GetIPList function
This commit is contained in:
parent
a7d7631feb
commit
84d7d744e2
1 changed files with 3 additions and 0 deletions
|
@ -107,6 +107,7 @@ void DNSResolveFree(addrinfo *res)
|
|||
bool GetIPList(std::vector<std::string> &IP4s) {
|
||||
char ipstr[INET6_ADDRSTRLEN]; // We use IPv6 length since it's longer than IPv4
|
||||
#if defined(getifaddrs) // On Android: Requires __ANDROID_API__ >= 24
|
||||
WARN_LOG(SCENET, "GetIPList from defined(getifaddrs)");
|
||||
struct ifaddrs* ifAddrStruct = NULL;
|
||||
struct ifaddrs* ifa = NULL;
|
||||
|
||||
|
@ -134,6 +135,7 @@ bool GetIPList(std::vector<std::string> &IP4s) {
|
|||
return true;
|
||||
}
|
||||
#elif defined(SIOCGIFCONF) // Better detection on Linux/UNIX/MacOS/some Android
|
||||
WARN_LOG(SCENET, "GetIPList from defined(SIOCGIFCONF)");
|
||||
#include <linux/if.h>
|
||||
static struct ifreq ifreqs[32];
|
||||
struct ifconf ifconf;
|
||||
|
@ -166,6 +168,7 @@ bool GetIPList(std::vector<std::string> &IP4s) {
|
|||
close(sd);
|
||||
return true;
|
||||
#else // Fallback to POSIX/Cross-platform way but may not works well on Linux (ie. only shows 127.0.0.1)
|
||||
WARN_LOG(SCENET, "GetIPList from Fallback");
|
||||
struct addrinfo hints, * res, * p;
|
||||
memset(&hints, 0, sizeof hints);
|
||||
hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version
|
||||
|
|
Loading…
Add table
Reference in a new issue