summaryrefslogtreecommitdiff
path: root/drivers/unix/ip_unix.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2016-11-30 03:01:40 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2016-12-09 18:24:58 +0100
commit311f1f165be12ea290799e42f9951011d997ab40 (patch)
tree267ce12f32565c8012df3a598ff13253dfc8b9f7 /drivers/unix/ip_unix.cpp
parent4f07b595a17a633c65c5df43ecdaa37667a475e9 (diff)
Fix getaddrinfo failing on android
Diffstat (limited to 'drivers/unix/ip_unix.cpp')
-rw-r--r--drivers/unix/ip_unix.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp
index d998c63dfa..8b8e09c912 100644
--- a/drivers/unix/ip_unix.cpp
+++ b/drivers/unix/ip_unix.cpp
@@ -100,7 +100,12 @@ IP_Address IP_Unix::_resolve_hostname(const String& p_hostname, IP_Address::Addr
hints.ai_flags = 0;
} else {
hints.ai_family = AF_UNSPEC;
+#ifdef ANDROID_ENABLED
+ // AI_V4MAPPED is not supported by android getaadrinfo
+ hints.ai_flags = AI_ADDRCONFIG;
+#else
hints.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG);
+#endif
};
int s = getaddrinfo(p_hostname.utf8().get_data(), NULL, &hints, &result);