I don't see any reason why we should only have to look for a hosts file in the person...
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 2 Mar 2006 00:06:15 +0000 (00:06 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 2 Mar 2006 00:06:15 +0000 (00:06 +0000)
Add a try to use a global hosts file if one is available ...

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17441 f5534014-38df-0310-8fa8-9805f1628bb7

epan/addr_resolv.c

index e495f7d2fbb4c40ce7cf932d5299cba57e359a4a..1db6b2b0c58effcd6b4739cf347b9f77cd660c05 100644 (file)
@@ -1640,6 +1640,15 @@ host_name_lookup_init(void) {
   }
   g_free(hostspath);
 
+  /*
+   * Load the global hosts file, if we have one.
+   */
+  hostspath = get_datafile_path(ENAME_HOSTS);
+  if (!read_hosts_file(hostspath) && errno != ENOENT) {
+    report_open_failure(hostspath, errno, FALSE);
+  }
+  g_free(hostspath);
+
 #ifdef HAVE_GNU_ADNS
   /*
    * We're using GNU ADNS, which doesn't check the system hosts file;