diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-07-09 10:00:13 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2014-07-29 08:03:46 (GMT) |
commit | 690cb7e85ff9dadbfca3e3bc91826161011712f1 (patch) | |
tree | 0692da9133e4a62642ab0a77040e7555cdc5565d /3rdParty/Unbound/01_android_fixes.diff | |
parent | 8767caf20b83f5b6e4c52c3818c92a6238e208c4 (diff) | |
download | swift-690cb7e85ff9dadbfca3e3bc91826161011712f1.zip swift-690cb7e85ff9dadbfca3e3bc91826161011712f1.tar.bz2 |
Fix DNS resolution on Android.
Test-Information:
Try accessing local hosts on a local network and make sure that the local DNS server is queried.
Change-Id: Ie594b3eed5772c58d46ec1a4435b2df24d6d8212
Diffstat (limited to '3rdParty/Unbound/01_android_fixes.diff')
-rw-r--r-- | 3rdParty/Unbound/01_android_fixes.diff | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/3rdParty/Unbound/01_android_fixes.diff b/3rdParty/Unbound/01_android_fixes.diff index c8144ad..40b01e0 100644 --- a/3rdParty/Unbound/01_android_fixes.diff +++ b/3rdParty/Unbound/01_android_fixes.diff @@ -1,13 +1,30 @@ ---- a/3rdParty/Unbound/src/unbound/libunbound/libunbound.c -+++ b/3rdParty/Unbound/src/unbound/libunbound/libunbound.c -@@ -812,6 +812,10 @@ ub_ctx_resolvconf(struct ub_ctx* ctx, char* fname) +diff -rupN ./3rdParty/Unbound/src/unbound/libunbound/libunbound.c ./3rdParty/Unbound/src/unbound/libunbound/libunbound.c +--- ./3rdParty/Unbound/src/unbound/libunbound/libunbound.c 2012-01-12 13:52:38.000000000 +0000 ++++ ./3rdParty/Unbound/src/unbound/libunbound/libunbound.c 2014-07-10 09:21:22.999839053 +0100 +@@ -66,6 +66,10 @@ + #include <iphlpapi.h> + #endif /* UB_ON_WINDOWS */ + ++#ifdef __ANDROID__ ++#include "dns_android.h" ++#endif ++ + struct ub_ctx* + ub_ctx_create(void) + { +@@ -811,6 +815,15 @@ ub_ctx_resolvconf(struct ub_ctx* ctx, ch + char buf[1024]; char* parse, *addr; int r; - +#ifdef __ANDROID__ -+ ub_ctx_set_fwd(ctx, "8.8.8.8"); -+ ub_ctx_set_fwd(ctx, "8.8.4.4"); ++ int i; ++ r = dns_android_server_count(); ++ for (i = 0; i < r; ++i) { ++ if (dns_android_server_get(i, buf, sizeof(buf)) == DNS_ANDROID_SUCCESS) { ++ ub_ctx_set_fwd(ctx, buf); ++ } ++ } +#endif + if(fname == NULL) { #if !defined(UB_ON_WINDOWS) || !defined(HAVE_WINDOWS_H) - fname = "/etc/resolv.conf";
\ No newline at end of file |