diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2013-11-27 16:23:09 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2013-12-20 16:45:25 -0800 |
commit | eb9a2ce9e57a51e3180eec2fe2bbdae7958e62ab (patch) | |
tree | 88712b1838a89911569112212ef56ccab19848c3 | |
parent | 15e069e25b7d1818ce2fdac8e175ca4db9c2742b (diff) | |
download | bionic-eb9a2ce9e57a51e3180eec2fe2bbdae7958e62ab.zip bionic-eb9a2ce9e57a51e3180eec2fe2bbdae7958e62ab.tar.gz bionic-eb9a2ce9e57a51e3180eec2fe2bbdae7958e62ab.tar.bz2 |
Fix dns search domain use in gethostbyname.
Need to load search domain data before we attempt to use it.
bug:6799630
Change-Id: Ib228f4ca260339f71a2e28d5930c0a722bd43c92
-rw-r--r-- | libc/netbsd/resolv/res_query.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libc/netbsd/resolv/res_query.c b/libc/netbsd/resolv/res_query.c index 8e1321e..d31e83c 100644 --- a/libc/netbsd/resolv/res_query.c +++ b/libc/netbsd/resolv/res_query.c @@ -272,6 +272,15 @@ res_nsearch(res_state statp, (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0U)) { int done = 0; + /* Unfortunately we need to load interface info + * (dns servers, search domains) before + * the domain stuff is tried. Will have a better + * fix after thread pools are used as this will + * be loaded once for the thread instead of each + * time a query is tried. + */ + _resolv_populate_res_for_iface(statp); + for (domain = (const char * const *)statp->dnsrch; *domain && !done; domain++) { |