diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2006-03-02 00:06:15 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2006-03-02 00:06:15 +0000 |
commit | b38db335d312668123495921a199f665327df33d (patch) | |
tree | b107dabea8f06b8e0a4adefa9eb83119f7a4d352 /epan/addr_resolv.c | |
parent | 050525cfb532ad640dc8bc2b9cbd6815bb7b7e60 (diff) | |
download | wireshark-b38db335d312668123495921a199f665327df33d.tar.gz wireshark-b38db335d312668123495921a199f665327df33d.tar.bz2 wireshark-b38db335d312668123495921a199f665327df33d.zip |
I don't see any reason why we should only have to look for a hosts file in the personal preferences file, but not in the datafile path, as we doing it for a lot of other config files at runtime.
Add a try to use a global hosts file if one is available ...
svn path=/trunk/; revision=17441
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r-- | epan/addr_resolv.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index e495f7d2fb..1db6b2b0c5 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -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; |