afef0a0409
problem in OSX, it breaks reading from capture files. From Brian Keefer.
41 lines
1.3 KiB
Plaintext
41 lines
1.3 KiB
Plaintext
$OpenBSD: patch-dnstop_c,v 1.3 2010/10/14 07:29:44 sthen Exp $
|
|
|
|
ns_r_refused comes from /usr/include/arpa/nameser.h on systems using
|
|
bind 9-based resolvers; REFUSED is equivalent.
|
|
|
|
--- dnstop.c.orig Wed Jan 28 20:40:06 2009
|
|
+++ dnstop.c Thu Oct 14 08:23:37 2010
|
|
@@ -45,6 +45,7 @@ static const char *Version = "20090128";
|
|
#include <netdb.h>
|
|
|
|
#ifdef HAVE_NET_IF_PPP_H
|
|
+#include <net/ppp_defs.h>
|
|
#include <net/if_ppp.h>
|
|
#define PPP_ADDRESS_VAL 0xff /* The address byte value */
|
|
#define PPP_CONTROL_VAL 0x03 /* The control byte value */
|
|
@@ -1630,7 +1631,7 @@ RFC1918PtrFilter(FilterData *fd)
|
|
int
|
|
RcodeRefusedFilter(FilterData *fd)
|
|
{
|
|
- return ns_r_refused == fd->rcode ? 1 : 0;
|
|
+ return REFUSED == fd->rcode ? 1 : 0;
|
|
}
|
|
|
|
void
|
|
@@ -1839,6 +1840,7 @@ main(int argc, char *argv[])
|
|
fprintf(stderr, "pcap_setfilter failed\n");
|
|
exit(1);
|
|
}
|
|
+#if 0 /* breaks reading from capture files on OpenBSD */
|
|
/*
|
|
* non-blocking call added for Mac OS X bugfix. Sent by Max Horn. ref
|
|
* http://www.tcpdump.org/lists/workers/2002/09/msg00033.html
|
|
@@ -1848,6 +1850,7 @@ main(int argc, char *argv[])
|
|
fprintf(stderr, "pcap_setnonblock failed: %s\n", errbuf);
|
|
exit(1);
|
|
}
|
|
+#endif
|
|
switch (pcap_datalink(pcap)) {
|
|
case DLT_EN10MB:
|
|
handle_datalink = handle_ether;
|