summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornatano <natano@openbsd.org>2016-05-03 07:41:24 +0000
committernatano <natano@openbsd.org>2016-05-03 07:41:24 +0000
commit2cadabfa6c679992d2046dcce6af54fc3fcf3dcb (patch)
tree0635f7b94cc5b60d1fe5f9cfe34d33a0ec72edf1
parentMove to /dev/bpf; ok lteo (diff)
downloadwireguard-openbsd-2cadabfa6c679992d2046dcce6af54fc3fcf3dcb.tar.xz
wireguard-openbsd-2cadabfa6c679992d2046dcce6af54fc3fcf3dcb.zip
Move to /dev/bpf; ok lteo
-rw-r--r--usr.sbin/tcpdump/privsep_pcap.c12
-rw-r--r--usr.sbin/tcpdump/tcpdump.86
2 files changed, 6 insertions, 12 deletions
diff --git a/usr.sbin/tcpdump/privsep_pcap.c b/usr.sbin/tcpdump/privsep_pcap.c
index 463e2871ae9..1ca6c7fb3ff 100644
--- a/usr.sbin/tcpdump/privsep_pcap.c
+++ b/usr.sbin/tcpdump/privsep_pcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep_pcap.c,v 1.19 2015/10/01 13:18:40 jsg Exp $ */
+/* $OpenBSD: privsep_pcap.c,v 1.20 2016/05/03 07:41:24 natano Exp $ */
/*
* Copyright (c) 2004 Can Erkin Acar
@@ -175,20 +175,14 @@ int
pcap_live(const char *device, int snaplen, int promisc, u_int dlt,
u_int dirfilt)
{
- char bpf[sizeof "/dev/bpf0000000000"];
- int fd, n = 0;
+ int fd;
struct ifreq ifr;
unsigned v;
if (device == NULL || snaplen <= 0)
return (-1);
- do {
- snprintf(bpf, sizeof(bpf), "/dev/bpf%d", n++);
- fd = open(bpf, O_RDONLY);
- } while (fd < 0 && errno == EBUSY);
-
- if (fd < 0)
+ if ((fd = open("/dev/bpf", O_RDONLY)) == -1)
return (-1);
v = 32768; /* XXX this should be a user-accessible hook */
diff --git a/usr.sbin/tcpdump/tcpdump.8 b/usr.sbin/tcpdump/tcpdump.8
index 62849a882ca..5bfe8a429f3 100644
--- a/usr.sbin/tcpdump/tcpdump.8
+++ b/usr.sbin/tcpdump/tcpdump.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tcpdump.8,v 1.89 2016/03/31 15:53:25 schwarze Exp $
+.\" $OpenBSD: tcpdump.8,v 1.90 2016/05/03 07:41:24 natano Exp $
.\"
.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996
.\" The Regents of the University of California. All rights reserved.
@@ -19,7 +19,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.Dd $Mdocdate: March 31 2016 $
+.Dd $Mdocdate: May 3 2016 $
.Dt TCPDUMP 8
.Os
.Sh NAME
@@ -44,7 +44,7 @@
prints out the headers of packets on a network interface that match the boolean
.Ar expression .
You must have read access to
-.Pa /dev/bpf* .
+.Pa /dev/bpf .
.Pp
The options are as follows:
.Bl -tag -width "-c count"