net/libpcap: Fix build

Fix build issues since if_pflog.h added a net/bpf.h include

Obtained from:	https://github.com/the-tcpdump-group/libpcap/pull/1074
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost 2021-12-22 13:04:17 -03:00 committed by Renato Botelho
parent cc6aef99d6
commit 7075bf819e
3 changed files with 34 additions and 0 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= libpcap
PORTVERSION= 1.10.1
PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://www.tcpdump.org/release/

View file

@ -0,0 +1,20 @@
--- gencode.c.orig 2021-06-07 20:21:35 UTC
+++ gencode.c
@@ -59,10 +59,16 @@
#include <sys/socket.h>
#include <net/if.h>
#include <net/pfvar.h>
-#include <net/if_pflog.h>
#endif /* HAVE_NET_PFVAR_H */
#include "pcap-int.h"
+
+#ifdef HAVE_NET_PFVAR_H
+/* FreeBSD includes <net/bpf.h> from <net/if_pflog.h>, and indirectly includes
+ * <net/dlt.h>. The FreeBSD version lacks DLT_IEEE802_15_4_TAP, so we really
+ * want to use our own version. */
+#include <net/if_pflog.h>
+#endif /* HAVE_NET_PFVAR_H */
#include "extract.h"

View file

@ -0,0 +1,13 @@
--- pcap/bpf.h.orig 2021-06-07 20:21:35 UTC
+++ pcap/bpf.h
@@ -78,6 +78,10 @@
*/
#if !defined(_NET_BPF_H_) && !defined(_NET_BPF_H_INCLUDED) && !defined(_BPF_H_) && !defined(_H_BPF) && !defined(lib_pcap_bpf_h)
#define lib_pcap_bpf_h
+#define _NET_BPF_H_
+#define _NET_BPF_H_INCLUDED
+#define _BPF_H_
+#define _H_BPF
#include <pcap/funcattrs.h>