diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-10-28 13:22:20 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2010-10-28 13:22:20 -0700 |
commit | 7858564582ca134bd0101ffc725c0d0b1d29d645 (patch) | |
tree | 000810d4ee7dbfa0802a10b06da8b589ddc62254 /libc/netbsd/net/getaddrinfo.c | |
parent | 78778cdd8c00ff0eff9de1b73891162bf3670e2d (diff) | |
download | android_bionic-7858564582ca134bd0101ffc725c0d0b1d29d645.tar.gz android_bionic-7858564582ca134bd0101ffc725c0d0b1d29d645.tar.bz2 android_bionic-7858564582ca134bd0101ffc725c0d0b1d29d645.zip |
Don't proxy getaddrinfo when net.dns1.[MYPID] is set.
Part of on-going DNS proxy/cache work.
Bug: 1146676
Change-Id: I5e6028169c81c2223efc34c3b57e348c44f26d26
Diffstat (limited to 'libc/netbsd/net/getaddrinfo.c')
-rw-r--r-- | libc/netbsd/net/getaddrinfo.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c index 4fa92b74b..451065246 100644 --- a/libc/netbsd/net/getaddrinfo.c +++ b/libc/netbsd/net/getaddrinfo.c @@ -103,6 +103,10 @@ #include <stdarg.h> #include "nsswitch.h" +#ifdef ANDROID_CHANGES +#include <sys/system_properties.h> +#endif /* ANDROID_CHANGES */ + typedef union sockaddr_union { struct sockaddr generic; struct sockaddr_in in; @@ -399,6 +403,16 @@ android_getaddrinfo_proxy( return -1; } + // Temporary cautious hack to disable the DNS proxy for processes + // requesting special treatment. Ideally the DNS proxy should + // accomodate these apps, though. + char propname[PROP_NAME_MAX]; + char propvalue[PROP_VALUE_MAX]; + snprintf(propname, sizeof(propname), "net.dns1.%d", getpid()); + if (__system_property_get(propname, propvalue) > 0) { + return -1; + } + // Bogus things we can't serialize. Don't use the proxy. if ((hostname != NULL && strcspn(hostname, " \n\r\t^'\"") != strlen(hostname)) || |