bionic/libc/netbsd/resolv
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
..
__dn_comp.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
__res_close.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
__res_send.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
herror.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_cache.c Fix spurious DNS lookups in the C library. 2010-03-08 15:22:13 -08:00
res_comp.c Make the DNS resolver accept domain names with an underscore. 2009-07-27 19:19:29 +02:00
res_compat.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_data.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_debug.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_debug.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_init.c Fix spurious DNS lookups in the C library. 2010-03-08 15:22:13 -08:00
res_mkquery.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_private.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_query.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_random.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
res_send.c Make IPv6 definitions comply with RFC 3493: 2009-06-16 18:55:37 -07:00
res_state.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00