Now that /dev/bpf has been around for two releases, it should be safe to
move the base tools to /dev/bpf. No need to worry about the upgrade path
anymore.

Ok?

natano


Index: lib/libpcap/pcap-bpf.c
===================================================================
RCS file: /cvs/src/lib/libpcap/pcap-bpf.c,v
retrieving revision 1.34
diff -u -p -r1.34 pcap-bpf.c
--- lib/libpcap/pcap-bpf.c      8 May 2016 08:20:50 -0000       1.34
+++ lib/libpcap/pcap-bpf.c      18 Apr 2017 18:29:27 -0000
@@ -216,9 +216,9 @@ bpf_open(pcap_t *p)
 {
        int fd;
 
-       fd = open("/dev/bpf0", O_RDWR);
+       fd = open("/dev/bpf", O_RDWR);
        if (fd == -1 && errno == EACCES)
-               fd = open("/dev/bpf0", O_RDONLY);
+               fd = open("/dev/bpf", O_RDONLY);
 
        if (fd == -1) {
                if (errno == EACCES)
Index: sbin/dhclient/bpf.c
===================================================================
RCS file: /cvs/src/sbin/dhclient/bpf.c,v
retrieving revision 1.49
diff -u -p -r1.49 bpf.c
--- sbin/dhclient/bpf.c 18 Apr 2017 13:59:09 -0000      1.49
+++ sbin/dhclient/bpf.c 18 Apr 2017 18:30:47 -0000
@@ -78,13 +78,13 @@ if_register_bpf(struct interface_info *i
        struct ifreq ifr;
        int sock;
 
-       if ((sock = open("/dev/bpf0", O_RDWR | O_CLOEXEC)) == -1)
+       if ((sock = open("/dev/bpf", O_RDWR | O_CLOEXEC)) == -1)
                fatal("Can't open bpf");
 
        /* Set the BPF device to point at this interface. */
        strlcpy(ifr.ifr_name, ifi->name, IFNAMSIZ);
        if (ioctl(sock, BIOCSETIF, &ifr) < 0)
-               fatal("Can't attach interface %s to /dev/bpf0", ifi->name);
+               fatal("Can't attach interface %s to /dev/bpf", ifi->name);
 
        return (sock);
 }
Index: usr.sbin/arp/arp.c
===================================================================
RCS file: /cvs/src/usr.sbin/arp/arp.c,v
retrieving revision 1.78
diff -u -p -r1.78 arp.c
--- usr.sbin/arp/arp.c  15 Apr 2017 11:50:24 -0000      1.78
+++ usr.sbin/arp/arp.c  18 Apr 2017 18:31:21 -0000
@@ -821,7 +821,7 @@ wake(const char *ether_addr, const char 
        char                    *pname = NULL;
        int                      bpf;
 
-       if ((bpf = open("/dev/bpf0", O_RDWR)) == -1)
+       if ((bpf = open("/dev/bpf", O_RDWR)) == -1)
                err(1, "Failed to bind to bpf");
 
        if (iface == NULL) {
Index: usr.sbin/dhcpd/bpf.c
===================================================================
RCS file: /cvs/src/usr.sbin/dhcpd/bpf.c,v
retrieving revision 1.18
diff -u -p -r1.18 bpf.c
--- usr.sbin/dhcpd/bpf.c        18 Apr 2017 13:59:09 -0000      1.18
+++ usr.sbin/dhcpd/bpf.c        18 Apr 2017 18:31:37 -0000
@@ -77,7 +77,7 @@ if_register_bpf(struct interface_info *i
 {
        int sock;
 
-       if ((sock = open("/dev/bpf0", O_RDWR)) == -1)
+       if ((sock = open("/dev/bpf", O_RDWR)) == -1)
                fatal("Can't open bpf device");
 
        /* Set the BPF device to point at this interface. */
Index: usr.sbin/dhcrelay/bpf.c
===================================================================
RCS file: /cvs/src/usr.sbin/dhcrelay/bpf.c,v
retrieving revision 1.18
diff -u -p -r1.18 bpf.c
--- usr.sbin/dhcrelay/bpf.c     5 Apr 2017 14:40:56 -0000       1.18
+++ usr.sbin/dhcrelay/bpf.c     18 Apr 2017 18:31:56 -0000
@@ -72,7 +72,7 @@ if_register_bpf(struct interface_info *i
        int sock;
 
        /* Open the BPF device */
-       if ((sock = open("/dev/bpf0", O_RDWR)) == -1)
+       if ((sock = open("/dev/bpf", O_RDWR)) == -1)
                fatal("Can't open bpf device");
 
        /* Set the BPF device to point at this interface. */
Index: usr.sbin/dhcrelay6/bpf.c
===================================================================
RCS file: /cvs/src/usr.sbin/dhcrelay6/bpf.c,v
retrieving revision 1.1
diff -u -p -r1.1 bpf.c
--- usr.sbin/dhcrelay6/bpf.c    17 Mar 2017 14:45:16 -0000      1.1
+++ usr.sbin/dhcrelay6/bpf.c    18 Apr 2017 18:33:58 -0000
@@ -75,7 +75,7 @@ if_register_bpf(struct interface_info *i
        int sock;
 
        /* Open the BPF device */
-       if ((sock = open("/dev/bpf0", O_RDWR)) == -1)
+       if ((sock = open("/dev/bpf", O_RDWR)) == -1)
                fatal("Can't open bpf device");
 
        /* Set the BPF device to point at this interface. */
Index: usr.sbin/hostapd/hostapd.c
===================================================================
RCS file: /cvs/src/usr.sbin/hostapd/hostapd.c,v
retrieving revision 1.37
diff -u -p -r1.37 hostapd.c
--- usr.sbin/hostapd/hostapd.c  28 May 2016 07:00:18 -0000      1.37
+++ usr.sbin/hostapd/hostapd.c  18 Apr 2017 18:32:14 -0000
@@ -173,7 +173,7 @@ hostapd_bpf_open(u_int flags)
        int fd = -1;
        struct bpf_version bpv;
 
-       if ((fd = open("/dev/bpf0", flags)) == -1) {
+       if ((fd = open("/dev/bpf", flags)) == -1) {
                hostapd_fatal("unable to open BPF device: %s\n",
                    strerror(errno));
        }
Index: usr.sbin/mopd/common/pf.c
===================================================================
RCS file: /cvs/src/usr.sbin/mopd/common/pf.c,v
retrieving revision 1.16
diff -u -p -r1.16 pf.c
--- usr.sbin/mopd/common/pf.c   28 May 2016 07:00:18 -0000      1.16
+++ usr.sbin/mopd/common/pf.c   18 Apr 2017 18:32:33 -0000
@@ -98,7 +98,7 @@ pfInit(char *interface, int mode, u_shor
                insns
        };
 
-       if ((fd = open("/dev/bpf0", mode)) == -1) {
+       if ((fd = open("/dev/bpf", mode)) == -1) {
                syslog(LOG_ERR,"pfInit: open bpf %m");
                return (-1);
        }
Index: usr.sbin/npppd/npppd/privsep.c
===================================================================
RCS file: /cvs/src/usr.sbin/npppd/npppd/privsep.c,v
retrieving revision 1.22
diff -u -p -r1.22 privsep.c
--- usr.sbin/npppd/npppd/privsep.c      28 May 2016 07:00:18 -0000      1.22
+++ usr.sbin/npppd/npppd/privsep.c      18 Apr 2017 18:33:13 -0000
@@ -983,7 +983,7 @@ privsep_npppd_check_open(struct PRIVSEP_
                int readonly;
        } const allow_paths[] = {
                { NPPPD_DIR "/",        1,      1 },
-               { "/dev/bpf0",          0,      0 },
+               { "/dev/bpf",           0,      0 },
                { "/etc/resolv.conf",   0,      1 },
                { "/dev/tun",           1,      0 },
                { "/dev/pppx",          1,      0 }
Index: usr.sbin/npppd/pppoe/pppoed.c
===================================================================
RCS file: /cvs/src/usr.sbin/npppd/pppoe/pppoed.c,v
retrieving revision 1.20
diff -u -p -r1.20 pppoed.c
--- usr.sbin/npppd/pppoe/pppoed.c       28 May 2016 07:00:18 -0000      1.20
+++ usr.sbin/npppd/pppoe/pppoed.c       18 Apr 2017 18:33:28 -0000
@@ -273,7 +273,7 @@ pppoed_listener_start(pppoed_listener *_
                goto fail;
        }
 
-       if ((_this->bpf = priv_open("/dev/bpf0", O_RDWR)) == -1) {
+       if ((_this->bpf = priv_open("/dev/bpf", O_RDWR)) == -1) {
                pppoed_log(_pppoed, log_level, "Cannot open bpf: %m");
                goto fail;
        }
Index: usr.sbin/rarpd/rarpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/rarpd/rarpd.c,v
retrieving revision 1.71
diff -u -p -r1.71 rarpd.c
--- usr.sbin/rarpd/rarpd.c      20 Jan 2017 06:22:38 -0000      1.71
+++ usr.sbin/rarpd/rarpd.c      18 Apr 2017 18:34:20 -0000
@@ -244,8 +244,8 @@ rarp_open(char *device)
        struct ifreq ifr;
        u_int   dlt;
 
-       if ((fd = open("/dev/bpf0", O_RDWR)) == -1)
-               error("/dev/bpf0: %s", strerror(errno));
+       if ((fd = open("/dev/bpf", O_RDWR)) == -1)
+               error("/dev/bpf: %s", strerror(errno));
 
        /* Set immediate mode so packets are processed as they arrive. */
        immediate = 1;
Index: usr.sbin/rbootd/bpf.c
===================================================================
RCS file: /cvs/src/usr.sbin/rbootd/bpf.c,v
retrieving revision 1.25
diff -u -p -r1.25 bpf.c
--- usr.sbin/rbootd/bpf.c       28 May 2016 07:00:18 -0000      1.25
+++ usr.sbin/rbootd/bpf.c       18 Apr 2017 18:34:40 -0000
@@ -84,7 +84,7 @@ BpfOpen(void)
        struct ifreq ifr;
        int n;
 
-       if ((BpfFd = open("/dev/bpf0", O_RDWR)) == -1) {
+       if ((BpfFd = open("/dev/bpf", O_RDWR)) == -1) {
                syslog(LOG_ERR, "bpf: can't open device: %m");
                DoExit();
        }
Index: usr.sbin/rbootd/rbootd.8
===================================================================
RCS file: /cvs/src/usr.sbin/rbootd/rbootd.8,v
retrieving revision 1.16
diff -u -p -r1.16 rbootd.8
--- usr.sbin/rbootd/rbootd.8    28 May 2016 07:00:18 -0000      1.16
+++ usr.sbin/rbootd/rbootd.8    18 Apr 2017 18:34:58 -0000
@@ -135,7 +135,7 @@ Turn off debugging, do nothing if alread
 .El
 .Sh FILES
 .Bl -tag -width /usr/libexec/rbootd -compact
-.It Pa /dev/bpf0
+.It Pa /dev/bpf
 packet-filter device
 .It Pa /etc/rbootd.conf
 configuration file
Index: usr.sbin/tcpdump/privsep_pcap.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/privsep_pcap.c,v
retrieving revision 1.21
diff -u -p -r1.21 privsep_pcap.c
--- usr.sbin/tcpdump/privsep_pcap.c     8 May 2016 08:20:50 -0000       1.21
+++ usr.sbin/tcpdump/privsep_pcap.c     18 Apr 2017 18:36:12 -0000
@@ -182,7 +182,7 @@ pcap_live(const char *device, int snaple
        if (device == NULL || snaplen <= 0)
                return (-1);
 
-       if ((fd = open("/dev/bpf0", O_RDONLY)) == -1)
+       if ((fd = open("/dev/bpf", O_RDONLY)) == -1)
                return (-1);
 
        v = 32768;      /* XXX this should be a user-accessible hook */
Index: usr.sbin/tcpdump/tcpdump.8
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/tcpdump.8,v
retrieving revision 1.91
diff -u -p -r1.91 tcpdump.8
--- usr.sbin/tcpdump/tcpdump.8  8 May 2016 08:20:50 -0000       1.91
+++ usr.sbin/tcpdump/tcpdump.8  18 Apr 2017 18:36:29 -0000
@@ -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/bpf0 .
+.Pa /dev/bpf .
 .Pp
 The options are as follows:
 .Bl -tag -width "-c count"

Reply via email to