d378c68d74
The problem was that the 'defdname' field of res_state structure was not properly initialized in __res_vinit(). This field is used to store the default domain name, which is normally build from calling gethostname() (see line 549 of res_init.c). Unfortunately, in the typical Android case, gethostname() returns an error (the hostname is configured) and a random stack string is used later to build the DNS search list (see lines 556+ in res_init.c) For the sake of illustration, let's say the search list is set to a random value like 'xWLK'. The end result is that when trying to result an unknown domain name (e.g. 'www.ptn'), the query fails then the resolver tries to make a new query with the DNS search list path(s) appended (e.g. 'www.ptn.xWLK'). The patch simply initializes 'defdname' to an empty string to avoid this when the net.dns.search system property is not set. Also contains whitespace/formatting fixes |
||
---|---|---|
.. | ||
isc | ||
arpa_nameser.h | ||
arpa_nameser_compat.h | ||
bionic_tls.h | ||
ctype_private.h | ||
logd.h | ||
nsswitch.h | ||
rand48.h | ||
resolv_cache.h | ||
resolv_private.h | ||
resolv_static.h | ||
syscommon.h | ||
thread_private.h |