summaryrefslogtreecommitdiffstats
path: root/contrib/libpcap/pcap-bpf.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libpcap/pcap-bpf.c')
-rw-r--r--contrib/libpcap/pcap-bpf.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/contrib/libpcap/pcap-bpf.c b/contrib/libpcap/pcap-bpf.c
index 4a94cda..97bd602 100644
--- a/contrib/libpcap/pcap-bpf.c
+++ b/contrib/libpcap/pcap-bpf.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.86.2.4 2005/06/04 02:53:16 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.86.2.8 2005/07/10 10:55:31 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -105,7 +105,7 @@ static int odmlockid = 0;
#include "gencode.h" /* for "no_optimize" */
static int pcap_setfilter_bpf(pcap_t *p, struct bpf_program *fp);
-static int pcap_setdirection_bpf(pcap_t *, direction_t);
+static int pcap_setdirection_bpf(pcap_t *, pcap_direction_t);
static int pcap_set_datalink_bpf(pcap_t *p, int dlt);
static int
@@ -746,7 +746,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
u_int i;
int is_ethernet;
- bdl.bfl_list = (u_int *) malloc(sizeof(u_int) * (bdl.bfl_len + 1));
+ bdl.bfl_list = (u_int *) malloc(sizeof(u_int) * bdl.bfl_len + 1);
if (bdl.bfl_list == NULL) {
(void)snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
pcap_strerror(errno));
@@ -997,9 +997,6 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
* there (and in sufficiently recent versions of OpenBSD
* "select()" and "poll()" should work correctly).
*
- * In addition, in Mac OS X 10.4, "select()" and "poll()" don't
- * work on *any* character devices, including BPF devices.
- *
* XXX - what about AIX?
*/
p->selectable_fd = p->fd; /* assume select() works until we know otherwise */
@@ -1011,9 +1008,6 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
if (strncmp(osinfo.release, "4.3-", 4) == 0 ||
strncmp(osinfo.release, "4.4-", 4) == 0)
p->selectable_fd = -1;
- } else if (strcmp(osinfo.sysname, "Darwin") == 0) {
- if (strncmp(osinfo.release, "8.", 2) == 0)
- p->selectable_fd = -1;
}
}
@@ -1095,26 +1089,26 @@ pcap_setfilter_bpf(pcap_t *p, struct bpf_program *fp)
* single device? IN, OUT or both?
*/
static int
-pcap_setdirection_bpf(pcap_t *p, direction_t d)
+pcap_setdirection_bpf(pcap_t *p, pcap_direction_t d)
{
#ifdef BIOCSSEESENT
u_int seesent;
#endif
/*
- * We don't support D_OUT.
+ * We don't support PCAP_D_OUT.
*/
- if (d == D_OUT) {
+ if (d == PCAP_D_OUT) {
snprintf(p->errbuf, sizeof(p->errbuf),
- "Setting direction to D_OUT is not supported on BPF");
+ "Setting direction to PCAP_D_OUT is not supported on BPF");
return -1;
}
#ifdef BIOCSSEESENT
- seesent = (d == D_INOUT);
+ seesent = (d == PCAP_D_INOUT);
if (ioctl(p->fd, BIOCSSEESENT, &seesent) == -1) {
(void) snprintf(p->errbuf, sizeof(p->errbuf),
"Cannot set direction to %s: %s",
- (d == D_INOUT) ? "D_INOUT" : "D_IN",
+ (d == PCAP_D_INOUT) ? "PCAP_D_INOUT" : "PCAP_D_IN",
strerror(errno));
return (-1);
}
OpenPOWER on IntegriCloud