From a1c4eb8794e789b5055d7ceb13b2b3231abf5e26 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 30 Jun 2017 20:19:10 +0200 Subject: resolv: Mirror the entire resolver configuration in struct resolv_conf This commit adds the remaining unchanging members (which are loaded from /etc/resolv.conf) to struct resolv_conf. The extended name server list is currently not used by the stub resolver. The switch depends on a cleanup: The _u._ext.nssocks array stores just a single socket, and needs to be replaced with a single socket value. (The compatibility gethostname implementation does not use the extended addres sort list, either. Updating the compat code is not worthwhile.) --- ChangeLog | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 0061126..6478aed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,41 @@ 2017-06-30 Florian Weimer + Mirror the entire resolver configuration in struct resolv_conf. + * resolv/resolv_context.h (__resolv_context_nameserver_count) + (__resolv_context_nameserver): New functions. + (__resolv_context_sort_count, __resolv_context_sort_entry): + Likewise. + * resolv/nss_dns/dns-host.c (getanswer_r): Add struct + resolv_context parameter. + (gethostbyname3_context, _nss_dns_gethostbyaddr2_r): Adjust. + (addrsort): Switch to struct resolv_context. + * resolv/resolv_conf.h (struct resolv_sortlist_entry): Define. + (struct resolv_conf): Add nameserver_list, nameserver_list_size, + sort_list, sort_list_size, options, retrans, retry, ndots members. + * resolv/resolv_conf.c (same_address_v4, same_address_v6) + (same_address): New functions. + (resolv_conf_matches): Compare the new array members. + (__resolv_conf_allocate): Allocate and copy the new array members. + (update_from_conf): Copy the entire configuration. + * resolv/res_init.c (struct nameserver_list, struct sort_list): + Define using dynarray. + (struct resolv_conf_parser): Add nameserver_list, sort_list, + template members. + (resolv_conf_parser_init): Add preinit argument. Initialize the + new members. + (resolv_conf_parser_free): Deallocate the new arrays. + (allocate_address_v4): New function. + (res_setoptions): Switch to struct resolv_conf_parser * parameter. + (res_vinit_1): Drop res_state parameter. Write all parsed date to + the parser object instead. Use allocate_address_v4 to allocate + IPv4 addresses. + (__res_vinit): Adjust. + * resolv/tst-resolv-res_init-skeleton.c (print_resp): Print the + extended name server list. + (test_cases): Adjust. + +2017-06-30 Florian Weimer + [BZ #19569] [BZ #21475] Support an arbitrary number of search domains. -- cgit v1.1