Get rid of add_async_dns_ipv4().
authorGuy Harris <guy@alum.mit.edu>
Sun, 20 May 2018 02:59:21 +0000 (19:59 -0700)
committerGuy Harris <guy@alum.mit.edu>
Sun, 20 May 2018 03:00:26 +0000 (03:00 +0000)
We don't have add_async_dns_ipv6(), we just do the same stuff inline in
host_lookup6(); this removes an irrelevant difference between
host_lookup() and host_lookup6().

Change-Id: Ib4aa1783ddec1bc390e2a7f64c87f1c8441fa849
Reviewed-on: https://code.wireshark.org/review/27661
Reviewed-by: Guy Harris <guy@alum.mit.edu>
epan/addr_resolv.c

index f918d92eca7ff7732ecdf78bb0e4d8a1682553d3..b71231877b237d3dd7ef371d6fc49a6de2bfd889 100644 (file)
@@ -345,18 +345,6 @@ static ares_channel ghbn_chan; /* ares_gethostbyname -- Usually interactive, tim
 static  gboolean  async_dns_initialized = FALSE;
 static  guint       async_dns_in_flight = 0;
 static  wmem_list_t *async_dns_queue_head = NULL;
-
-/* push a dns request */
-static void
-add_async_dns_ipv4(int type, guint32 addr)
-{
-    async_dns_queue_msg_t *msg;
-
-    msg = wmem_new(wmem_epan_scope(), async_dns_queue_msg_t);
-    msg->family = type;
-    msg->addr.ip4 = addr;
-    wmem_list_append(async_dns_queue_head, (gpointer) msg);
-}
 #endif /* HAVE_C_ARES */
 
 typedef struct {
@@ -861,6 +849,9 @@ static hashipv4_t *
 host_lookup(const guint addr)
 {
     hashipv4_t * volatile tp;
+#ifdef HAVE_C_ARES
+    async_dns_queue_msg_t *caqm;
+#endif
 
     tp = (hashipv4_t *)wmem_map_lookup(ipv4_hash_table, GUINT_TO_POINTER(addr));
     if (tp == NULL) {
@@ -888,7 +879,10 @@ host_lookup(const guint addr)
 
 #ifdef HAVE_C_ARES
         if (async_dns_initialized && name_resolve_concurrency > 0) {
-            add_async_dns_ipv4(AF_INET, addr);
+            caqm = wmem_new(wmem_epan_scope(), async_dns_queue_msg_t);
+            caqm->family = AF_INET;
+            caqm->addr.ip4 = addr;
+            wmem_list_append(async_dns_queue_head, (gpointer) caqm);
         }
 #endif
     }