Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109504753
D38575.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38575.diff
View Options
diff --git a/contrib/libpcap/pcap/bpf.h b/contrib/libpcap/pcap/bpf.h
--- a/contrib/libpcap/pcap/bpf.h
+++ b/contrib/libpcap/pcap/bpf.h
@@ -74,6 +74,18 @@
extern "C" {
#endif
+/*
+ * In the past, we modified pcap/pcap.h to include the system net/bpf.h,
+ * rather than this file. However, starting around 1.10.2, libpcap requires
+ * the extern functions defined here to build. Simply reverting that local
+ * change is not a solution, because some ports with '#include <pcap.h>'
+ * such as mail/spamd and net/xprobe require the system net/bpf.h to be
+ * pulled in. To accommodate both requirements, make this header a wrapper
+ * around the system net/bpf.h, but keep the extern function definitions.
+ */
+#if defined(__FreeBSD__)
+#include <net/bpf.h>
+#else
/* BSD style release date */
#define BPF_RELEASE 199606
@@ -244,13 +256,17 @@
#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
+#endif /* defined(__FreeBSD__) */
+
PCAP_API int bpf_validate(const struct bpf_insn *, int);
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
+#if !defined(__FreeBSD__)
/*
* Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
*/
#define BPF_MEMWORDS 16
+#endif
#ifdef __cplusplus
}
diff --git a/contrib/libpcap/pcap/pcap.h b/contrib/libpcap/pcap/pcap.h
--- a/contrib/libpcap/pcap/pcap.h
+++ b/contrib/libpcap/pcap/pcap.h
@@ -85,7 +85,10 @@
#endif /* _WIN32/MSDOS/UN*X */
#include <pcap/socket.h> /* for SOCKET, as the active-mode rpcap APIs use it */
-#include <net/bpf.h>
+
+#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
+#include <pcap/bpf.h>
+#endif
#include <stdio.h>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 6, 10:58 PM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16502630
Default Alt Text
D38575.diff (1 KB)
Attached To
Mode
D38575: libpcap: Make pcap/bpf.h a minimal wrapper around net/bpf.h
Attached
Detach File
Event Timeline
Log In to Comment