aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-20 19:19:41 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-20 19:19:41 +0000
commitec46daf88b0219601da889099a668b06625016f7 (patch)
treeb231f5d84d98a097c33a16bb8f4191197ccf3474 /epan
parente9121f9498d43afda3cc01dc4de853001b832859 (diff)
downloadwireshark-ec46daf88b0219601da889099a668b06625016f7.tar.gz
wireshark-ec46daf88b0219601da889099a668b06625016f7.tar.bz2
wireshark-ec46daf88b0219601da889099a668b06625016f7.zip
Work around Windows' annoying decision to map 0.0.0.0 to the local host
name in "gethostbyaddr()". svn path=/trunk/; revision=4433
Diffstat (limited to 'epan')
-rw-r--r--epan/resolv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/resolv.c b/epan/resolv.c
index 831187c851..f763a3df33 100644
--- a/epan/resolv.c
+++ b/epan/resolv.c
@@ -1,7 +1,7 @@
/* resolv.c
* Routines for network object lookup
*
- * $Id: resolv.c,v 1.18 2001/11/21 01:00:37 guy Exp $
+ * $Id: resolv.c,v 1.19 2001/12/20 19:19:41 guy Exp $
*
* Laurent Deniel <deniel@worldnet.fr>
*
@@ -289,7 +289,13 @@ static guchar *host_name_lookup(guint addr, gboolean *found)
tp->addr = addr;
tp->next = NULL;
- if (prefs.name_resolve & PREFS_RESOLV_NETWORK) {
+ /*
+ * The Windows "gethostbyaddr()" insists on translating 0.0.0.0 to
+ * the name of the host on which it's running; to work around that
+ * botch, we don't try to translate an all-zero IP address to a host
+ * name.
+ */
+ if (addr != 0 && (prefs.name_resolve & PREFS_RESOLV_NETWORK)) {
#ifdef AVOID_DNS_TIMEOUT
/* Quick hack to avoid DNS/YP timeout */