summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/NetworkSingleton.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2016-11-07 23:15:07 +0100
committerAlexander Harkness <me@bearbin.net>2016-12-12 15:32:32 +0100
commit8c6d0b51c719e1817e308375d129b17ede3b82fc (patch)
tree8aa23d1db5e4198f6aeed5091ad6adedc12fea35 /src/OSSupport/NetworkSingleton.cpp
parentMerge pull request #3476 from Seadragon91/patch-1 (diff)
downloadcuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.gz
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.bz2
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.lz
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.xz
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.zst
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/NetworkSingleton.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/OSSupport/NetworkSingleton.cpp b/src/OSSupport/NetworkSingleton.cpp
index dcf17bccb..3a8dbbdc7 100644
--- a/src/OSSupport/NetworkSingleton.cpp
+++ b/src/OSSupport/NetworkSingleton.cpp
@@ -13,6 +13,11 @@
#include "IPLookup.h"
#include "HostnameLookup.h"
+#ifdef ANDROID
+ // For DNS server retrieval
+ #include <sys/system_properties.h>
+#endif
+
@@ -89,6 +94,16 @@ void cNetworkSingleton::Initialise(void)
abort();
}
+ #ifdef ANDROID
+ char PropertyBuffer[PROP_VALUE_MAX];
+
+ __system_property_get("net.dns1", PropertyBuffer);
+ evdns_base_nameserver_ip_add(m_DNSBase, PropertyBuffer);
+
+ __system_property_get("net.dns2", PropertyBuffer);
+ evdns_base_nameserver_ip_add(m_DNSBase, PropertyBuffer);
+ #endif
+
// Create the event loop thread:
m_HasTerminated = false;
m_EventLoopThread = std::thread(RunEventLoop, this);