Don't proxy getaddrinfo when net.dns1.[MYPID] is set.
Part of on-going DNS proxy/cache work. Bug: 1146676 Change-Id: I5e6028169c81c2223efc34c3b57e348c44f26d26
This commit is contained in:
parent
52583cc679
commit
555e02dee7
@ -103,6 +103,10 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "nsswitch.h"
|
#include "nsswitch.h"
|
||||||
|
|
||||||
|
#ifdef ANDROID_CHANGES
|
||||||
|
#include <sys/system_properties.h>
|
||||||
|
#endif /* ANDROID_CHANGES */
|
||||||
|
|
||||||
typedef union sockaddr_union {
|
typedef union sockaddr_union {
|
||||||
struct sockaddr generic;
|
struct sockaddr generic;
|
||||||
struct sockaddr_in in;
|
struct sockaddr_in in;
|
||||||
@ -399,6 +403,16 @@ android_getaddrinfo_proxy(
|
|||||||
return -1;
|
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.
|
// Bogus things we can't serialize. Don't use the proxy.
|
||||||
if ((hostname != NULL &&
|
if ((hostname != NULL &&
|
||||||
strcspn(hostname, " \n\r\t^'\"") != strlen(hostname)) ||
|
strcspn(hostname, " \n\r\t^'\"") != strlen(hostname)) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user