bionic/libc/private
David 'Digit' Turner d378c68d74 Fix spurious DNS lookups in the C library.
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
2010-03-08 15:22:13 -08:00
..
isc auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
arpa_nameser_compat.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
arpa_nameser.h Fix spurious DNS lookups in the C library. 2010-03-08 15:22:13 -08:00
bionic_tls.h resolved conflicts for merge of 4a05d12c to eclair-plus-aosp 2009-09-22 15:41:36 -07:00
ctype_private.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
logd.h Prevent a crash in the memory leak checker (which happened in chk_free()) 2009-07-10 00:32:08 +02:00
nsswitch.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
rand48.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
resolv_cache.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
resolv_private.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
resolv_static.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
syscommon.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
thread_private.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00