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 |
||
---|---|---|
.. | ||
__dn_comp.c | ||
__res_close.c | ||
__res_send.c | ||
herror.c | ||
res_cache.c | ||
res_comp.c | ||
res_compat.c | ||
res_data.c | ||
res_debug.c | ||
res_debug.h | ||
res_init.c | ||
res_mkquery.c | ||
res_private.h | ||
res_query.c | ||
res_random.c | ||
res_send.c | ||
res_state.c |