aboutsummaryrefslogtreecommitdiffstats
path: root/epan/resolv.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-11-20 05:04:57 +0000
committerGuy Harris <guy@alum.mit.edu>2003-11-20 05:04:57 +0000
commit1581057cc497120441cb2fb940b243e30406566a (patch)
tree907b2fe1cdd3d7db89c3dc935f8faa39b018dff7 /epan/resolv.c
parent6d5751b6e750ae9000c913f5e95184febc32faba (diff)
On Mac OS X, disable the alarm/longjmp stuff for timing out name
resolution queries - it runs a significant risk of crashing applications that do that. svn path=/trunk/; revision=9042
Diffstat (limited to 'epan/resolv.c')
-rw-r--r--epan/resolv.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/epan/resolv.c b/epan/resolv.c
index 2372e0be71..b7b0b2891e 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.37 2003/10/14 00:40:14 guy Exp $
+ * $Id: resolv.c,v 1.38 2003/11/20 05:04:57 guy Exp $
*
* Laurent Deniel <laurent.deniel@free.fr>
*
@@ -33,7 +33,20 @@
#include <stdlib.h>
#include <string.h>
-#ifndef WIN32
+/*
+ * Win32 doesn't have SIGALRM.
+ *
+ * Mac OS X does, but if you longjmp() out of a name resolution call in
+ * a signal handler, you might crash, because the state of the resolution
+ * code that sends messages to lookupd might be inconsistent if you jump
+ * out of it in middle of a call.
+ *
+ * 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
+ * picked up by tcpdump.org tcpdump.
+ */
+#if !defined(WIN32) && !defined(__APPLE__)
#ifndef AVOID_DNS_TIMEOUT
#define AVOID_DNS_TIMEOUT
#endif