From 51984de040b804ca6614830acc62c641cd6d8959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Tue, 22 Mar 2016 00:11:26 +0000 Subject: [PATCH] Remove more missed ADNS code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixup for 7a1d3f67ac83e12645a91b5329b6e8163954f77e. Change-Id: Idb8d68a3cc114545f24738cead4968804d831346 Reviewed-on: https://code.wireshark.org/review/14548 Petri-Dish: João Valverde Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/addr_resolv.c | 60 ---------------------------------------------- 1 file changed, 60 deletions(-) diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index d4d9db58a9..ec3a7df9b3 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -2730,14 +2730,6 @@ host_name_lookup_init(void) char *hostspath; guint i; -#ifdef HAVE_GNU_ADNS -#ifdef _WIN32 - char *sysroot; - static char rootpath_nt[] = "\\system32\\drivers\\etc\\hosts"; - static char rootpath_ot[] = "\\hosts"; -#endif /* _WIN32 */ -#endif /*GNU_ADNS */ - g_assert(ipxnet_hash_table == NULL); ipxnet_hash_table = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, g_free); @@ -2778,58 +2770,6 @@ host_name_lookup_init(void) #endif } #else -#ifdef HAVE_GNU_ADNS - /* - * We're using GNU ADNS, which doesn't check the system hosts file; - * we load that file ourselves. - */ -#ifdef _WIN32 - - sysroot = getenv_utf8("WINDIR"); - if (sysroot != NULL) { - /* - * The file should be under WINDIR. - * If this is Windows NT (NT 4.0,2K,XP,Server2K3), it's in - * %WINDIR%\system32\drivers\etc\hosts. - * If this is Windows OT (95,98,Me), it's in %WINDIR%\hosts. - * Try both. - * XXX - should we base it on the dwPlatformId value from - * GetVersionEx()? - */ - if (!gbl_resolv_flags.load_hosts_file_from_profile_only) { - hostspath = g_strconcat(sysroot, rootpath_nt, NULL); - if (!read_hosts_file(hostspath, TRUE)) { - g_free(hostspath); - hostspath = g_strconcat(sysroot, rootpath_ot, NULL); - read_hosts_file(hostspath, TRUE); - } - g_free(hostspath); - } - } -#else /* _WIN32 */ - if (!gbl_resolv_flags.load_hosts_file_from_profile_only) { - read_hosts_file("/etc/hosts", TRUE); - } -#endif /* _WIN32 */ - - if (gbl_resolv_flags.concurrent_dns) { - /* XXX - Any flags we should be using? */ - /* XXX - We could provide config settings for DNS servers, and - pass them to ADNS with adns_init_strcfg */ - if (adns_init(&ads, adns_if_none, 0 /*0=>stderr*/) != 0) { - /* - * XXX - should we report the error? I'm assuming that some crashes - * reported on a Windows machine with TCP/IP not configured are due - * to "adns_init()" failing (due to the lack of TCP/IP) and leaving - * ADNS in a state where it crashes due to that. We'll still try - * doing name resolution anyway. - */ - return; - } - async_dns_initialized = TRUE; - async_dns_in_flight = 0; - } -#endif /* HAVE_GNU_ADNS */ #endif /* HAVE_C_ARES */ if (extra_hosts_files && !gbl_resolv_flags.load_hosts_file_from_profile_only) {