diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/CMakeLists.txt | 1 | ||||
-rw-r--r-- | epan/Makefile.am | 1 | ||||
-rw-r--r-- | epan/Makefile.nmake | 6 | ||||
-rw-r--r-- | epan/addr_resolv.c | 129 | ||||
-rw-r--r-- | epan/addr_resolv.h | 2 | ||||
-rw-r--r-- | epan/epan.c | 8 |
6 files changed, 7 insertions, 140 deletions
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt index 49321d88e2..82d0169d3e 100644 --- a/epan/CMakeLists.txt +++ b/epan/CMakeLists.txt @@ -192,7 +192,6 @@ set(epan_LIBS ${GLIB2_LIBRARIES} ${PCAP_LIBRARIES} ${CARES_LIBRARIES} - ${ADNS_LIBRARIES} ${KERBEROS_LIBRARIES} ${GEOIP_LIBRARIES} ${GCRYPT_LIBRARIES} diff --git a/epan/Makefile.am b/epan/Makefile.am index 3a830e59df..1585861e7b 100644 --- a/epan/Makefile.am +++ b/epan/Makefile.am @@ -139,7 +139,6 @@ libwireshark_la_LIBADD = \ @SOCKET_LIBS@ \ @NSL_LIBS@ \ @C_ARES_LIBS@ \ - @ADNS_LIBS@ \ @LIBGCRYPT_LIBS@ \ @LIBGNUTLS_LIBS@ \ @KRB5_LIBS@ \ diff --git a/epan/Makefile.nmake b/epan/Makefile.nmake index 984bd85056..7ff028a60c 100644 --- a/epan/Makefile.nmake +++ b/epan/Makefile.nmake @@ -16,7 +16,7 @@ LINK= link COMMON_CFLAGS=\ $(STANDARD_CFLAGS) \ /I. /I.. $(GLIB_CFLAGS) \ - $(ZLIB_CFLAGS) $(C_ARES_CFLAGS) $(ADNS_CFLAGS) \ + $(ZLIB_CFLAGS) $(C_ARES_CFLAGS) \ $(LUA_CFLAGS) $(GNUTLS_CFLAGS) /I$(PCAP_DIR)\include \ $(SMI_CFLAGS) $(GEOIP_CFLAGS) @@ -56,7 +56,6 @@ WSLUA_DIR= libwireshark_LIBS = \ $(GLIB_LIBS) \ $(C_ARES_LIBS) \ - $(ADNS_LIBS) \ $(KFW_LIBS) \ $(ZLIB_LIBS) \ $(GNUTLS_LIBS) \ @@ -289,7 +288,6 @@ TVBTEST_LIBS= ..\wiretap\wiretap-$(WTAP_VERSION).lib \ dfilter\dfilter.lib \ ftypes\ftypes.lib \ $(C_ARES_LIBS) \ - $(ADNS_LIBS) \ $(ZLIB_LIBS) !ENDIF @@ -319,7 +317,6 @@ OIDS_TEST_LIBS= ..\wiretap\wiretap-$(WTAP_VERSION).lib \ ftypes\ftypes.lib \ wmem\wmem.lib \ $(C_ARES_LIBS) \ - $(ADNS_LIBS) \ $(ZLIB_LIBS) !ENDIF @@ -348,7 +345,6 @@ REASSEMBLE_TEST_LIBS= ..\wiretap\wiretap-$(WTAP_VERSION).lib \ dfilter\dfilter.lib \ ftypes\ftypes.lib \ $(C_ARES_LIBS) \ - $(ADNS_LIBS) \ $(ZLIB_LIBS) !ENDIF diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index f1c3d79335..d4d9db58a9 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -42,12 +42,6 @@ * resolution code that sends messages to lookupd might be inconsistent * if you jump out of it in middle of a call. * - * In at least some Linux distributions (e.g., RedHat Linux 9), if ADNS - * is used, we appear to hang in host_name_lookup6() in a gethostbyaddr() - * call (and possibly in other gethostbyaddr() calls), because there's - * a mutex lock held in gethostbyaddr() and it doesn't get released - * if we longjmp out of it. - * * There's no guarantee that longjmp()ing out of name resolution calls * will work on *any* platform; OpenBSD got rid of the alarm/longjmp * code in tcpdump, to avoid those sorts of problems, and that was @@ -94,14 +88,6 @@ # endif # include <ares.h> # include <ares_version.h> -#else -# ifdef HAVE_GNU_ADNS -# include <errno.h> -# include <adns.h> -# if defined(inet_aton) && defined(_WIN32) -# undef inet_aton -# endif -# endif /* HAVE_GNU_ADNS */ #endif /* HAVE_C_ARES */ #include <glib.h> @@ -304,7 +290,7 @@ e_addr_resolve gbl_resolv_flags = { FALSE, /* load_hosts_file_from_profile_only */ FALSE /* vlan_name */ }; -#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS) +#ifdef HAVE_C_ARES static guint name_resolve_concurrency = 500; #endif @@ -357,30 +343,8 @@ static void c_ares_ghba_cb(void *arg, int status, int timeouts _U_, struct hoste ares_channel ghba_chan; /* ares_gethostbyaddr -- Usually non-interactive, no timeout */ ares_channel ghbn_chan; /* ares_gethostbyname -- Usually interactive, timeout */ - -#else -/* GNU ADNS */ -#ifdef HAVE_GNU_ADNS -#define ASYNC_DNS -/* - * Submitted queries have to be checked individually using adns_check(). - * Queries are added to adns_queue_head. During processing, the list is - * iterated twice: once to request queries up to the concurrency limit, - * and once to check the status of each query. - */ - -adns_state ads; - -typedef struct _async_dns_queue_msg -{ - gboolean submitted; - guint32 ip4_addr; - int type; - adns_query query; -} async_dns_queue_msg_t; - -#endif /* HAVE_GNU_ADNS */ #endif /* HAVE_C_ARES */ + #ifdef ASYNC_DNS static gboolean async_dns_initialized = FALSE; static guint async_dns_in_flight = 0; @@ -393,18 +357,11 @@ add_async_dns_ipv4(int type, guint32 addr) async_dns_queue_msg_t *msg; msg = g_new(async_dns_queue_msg_t,1); -#ifdef HAVE_C_ARES msg->family = type; msg->addr.ip4 = addr; -#else - msg->type = type; - msg->ip4_addr = addr; - msg->submitted = FALSE; -#endif async_dns_queue_head = g_list_append(async_dns_queue_head, (gpointer) msg); } - -#endif +#endif /* ASYNC_DNS */ typedef struct { guint32 mask; @@ -2512,7 +2469,7 @@ addr_resolve_pref_init(module_t *nameres) " is enabled.", &gbl_resolv_flags.use_external_net_name_resolver); -#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS) +#ifdef HAVE_C_ARES prefs_register_bool_preference(nameres, "concurrent_dns", "Enable concurrent DNS name resolution", "Enable concurrent DNS name resolution. Only" @@ -2632,83 +2589,7 @@ _host_name_lookup_cleanup(void) { async_dns_initialized = FALSE; } -#elif defined(HAVE_GNU_ADNS) - -/* XXX - The ADNS "documentation" isn't very clear: - * - Do we need to keep our query structures around? - */ -gboolean -host_name_lookup_process(void) { - async_dns_queue_msg_t *almsg; - GList *cur; - char addr_str[] = "111.222.333.444.in-addr.arpa."; - guint8 *addr_bytes; - adns_answer *ans; - int ret; - gboolean dequeue; - gboolean nro = new_resolved_objects; - - new_resolved_objects = FALSE; - async_dns_queue_head = g_list_first(async_dns_queue_head); - - cur = async_dns_queue_head; - while (cur && async_dns_in_flight <= name_resolve_concurrency) { - almsg = (async_dns_queue_msg_t *) cur->data; - if (! almsg->submitted && almsg->type == AF_INET) { - addr_bytes = (guint8 *) &almsg->ip4_addr; - g_snprintf(addr_str, sizeof addr_str, "%u.%u.%u.%u.in-addr.arpa.", addr_bytes[3], - addr_bytes[2], addr_bytes[1], addr_bytes[0]); - /* XXX - what if it fails? */ - adns_submit (ads, addr_str, adns_r_ptr, adns_qf_none, NULL, &almsg->query); - almsg->submitted = TRUE; - async_dns_in_flight++; - } - cur = cur->next; - } - - cur = async_dns_queue_head; - while (cur) { - dequeue = FALSE; - almsg = (async_dns_queue_msg_t *) cur->data; - if (almsg->submitted) { - ret = adns_check(ads, &almsg->query, &ans, NULL); - if (ret == 0) { - if (ans->status == adns_s_ok) { - add_ipv4_name(almsg->ip4_addr, *ans->rrs.str); - } - dequeue = TRUE; - } - } - cur = cur->next; - if (dequeue) { - async_dns_queue_head = g_list_remove(async_dns_queue_head, (void *) almsg); - g_free(almsg); - /* XXX, what to do if async_dns_in_flight == 0? */ - async_dns_in_flight--; - } - } - - /* Keep the timeout in place */ - return nro; -} - -static void -_host_name_lookup_cleanup(void) { - void *qdata; - - async_dns_queue_head = g_list_first(async_dns_queue_head); - while (async_dns_queue_head) { - qdata = async_dns_queue_head->data; - async_dns_queue_head = g_list_remove(async_dns_queue_head, qdata); - g_free(qdata); - } - - if (async_dns_initialized) - adns_finish(ads); - async_dns_initialized = FALSE; -} - -#else /* HAVE_GNU_ADNS */ +#else gboolean host_name_lookup_process(void) { diff --git a/epan/addr_resolv.h b/epan/addr_resolv.h index 876aff2bc9..e1b49cdce8 100644 --- a/epan/addr_resolv.h +++ b/epan/addr_resolv.h @@ -173,7 +173,7 @@ extern void addr_resolve_pref_init(struct pref_module *nameres); */ WS_DLL_PUBLIC void disable_name_resolution(void); -/** If we're using c-ares or ADNS, process outstanding host name lookups. +/** If we're using c-ares process outstanding host name lookups. * This is called from a GLIB timeout in Wireshark and before processing * each packet in TShark. * diff --git a/epan/epan.c b/epan/epan.c index d33544e681..8f2a4d4962 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -511,14 +511,6 @@ epan_get_compiled_version_info(GString *str) g_string_append(str, "with c-ares " ARES_VERSION_STR); #else g_string_append(str, "without c-ares"); - - /* ADNS - only add if no c-ares */ - g_string_append(str, ", "); -#ifdef HAVE_GNU_ADNS - g_string_append(str, "with ADNS"); -#else - g_string_append(str, "without ADNS"); -#endif /* HAVE_GNU_ADNS */ #endif /* HAVE_C_ARES */ /* LUA */ |