pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/libpcap import from the NetBSD tree: use the cloni...
details: https://anonhg.NetBSD.org/pkgsrc/rev/dad926e8c7dc
branches: trunk
changeset: 508757:dad926e8c7dc
user: drochner <drochner%pkgsrc.org@localhost>
date: Fri Feb 24 22:53:41 2006 +0000
description:
import from the NetBSD tree: use the cloning /dev/bpf on NetBSD
if _PATH_BPF is defined
bump PKGREVISION
diffstat:
net/libpcap/Makefile | 3 +-
net/libpcap/distinfo | 3 +-
net/libpcap/patches/patch-ad | 48 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+), 2 deletions(-)
diffs (77 lines):
diff -r aa2eb39ff3e9 -r dad926e8c7dc net/libpcap/Makefile
--- a/net/libpcap/Makefile Fri Feb 24 21:59:49 2006 +0000
+++ b/net/libpcap/Makefile Fri Feb 24 22:53:41 2006 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.32 2005/12/08 06:32:30 uebayasi Exp $
+# $NetBSD: Makefile,v 1.33 2006/02/24 22:53:41 drochner Exp $
DISTNAME= libpcap-0.9.4
+PKGREVISION= 1
SVR4_PKGNAME= lpcap
CATEGORIES= net
MASTER_SITES= http://www.tcpdump.org/release/
diff -r aa2eb39ff3e9 -r dad926e8c7dc net/libpcap/distinfo
--- a/net/libpcap/distinfo Fri Feb 24 21:59:49 2006 +0000
+++ b/net/libpcap/distinfo Fri Feb 24 22:53:41 2006 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.13 2005/12/08 06:32:31 uebayasi Exp $
+$NetBSD: distinfo,v 1.14 2006/02/24 22:53:41 drochner Exp $
SHA1 (libpcap-0.9.4.tar.gz) = 046f7624e66da51eba1ed2cb169695d1e7f31c29
RMD160 (libpcap-0.9.4.tar.gz) = b8adee8f40256b8822e8e8b7da9a9bbd716ff6ab
Size (libpcap-0.9.4.tar.gz) = 425887 bytes
SHA1 (patch-ab) = ef8450b6f7ee050fcc40eec8ebdaa3fbb3ebdfe9
SHA1 (patch-ac) = 26148fe8cfbd0502fc13b0381ca31c4d02204b00
+SHA1 (patch-ad) = f9d2d6401a62d216b9f0af858fb1adde2098483e
diff -r aa2eb39ff3e9 -r dad926e8c7dc net/libpcap/patches/patch-ad
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/libpcap/patches/patch-ad Fri Feb 24 22:53:41 2006 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-ad,v 1.1 2006/02/24 22:53:41 drochner Exp $
+
+--- pcap-bpf.c.orig 2006-02-24 23:23:45.000000000 +0100
++++ pcap-bpf.c
+@@ -34,6 +34,9 @@ static const char rcsid[] _U_ =
+ #include <sys/file.h>
+ #include <sys/ioctl.h>
+ #include <sys/utsname.h>
++#ifdef __NetBSD__
++#include <paths.h>
++#endif
+
+ #include <net/if.h>
+
+@@ -523,8 +526,12 @@ static inline int
+ bpf_open(pcap_t *p, char *errbuf)
+ {
+ int fd;
++#ifndef _PATH_BPF
+ int n = 0;
+ char device[sizeof "/dev/bpf0000000000"];
++#else
++ const char *device = _PATH_BPF;
++#endif
+
+ #ifdef _AIX
+ /*
+@@ -536,6 +543,7 @@ bpf_open(pcap_t *p, char *errbuf)
+ return (-1);
+ #endif
+
++#ifndef _PATH_BPF
+ /*
+ * Go through all the minors and find one that isn't in use.
+ */
+@@ -566,6 +574,12 @@ bpf_open(pcap_t *p, char *errbuf)
+ if (fd < 0)
+ snprintf(errbuf, PCAP_ERRBUF_SIZE, "(no devices found) %s: %s",
+ device, pcap_strerror(errno));
++#else
++ if ((fd = open(device, O_RDWR)) == -1 &&
++ (errno != EACCES || (fd = open(device, O_RDONLY)) == -1))
++ snprintf(errbuf, PCAP_ERRBUF_SIZE,
++ "(cannot open device) %s: %s", device, pcap_strerror(errno));
++#endif
+
+ return (fd);
+ }
Home |
Main Index |
Thread Index |
Old Index