claudio wants to remove bpf_filter() from libpcap. So a couple of ports
need adjustments. This one is straightforward. Regress passes.
There are newer versions available since August (2.1.0 seems to be the
latest one). The bpf_filter() usage is the same. I haven't looked
further.
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/py-pcapy/Makefile,v
diff -u -p -r1.36 Makefile
--- Makefile 11 Aug 2026 12:42:46 -0000 1.36
+++ Makefile 27 Oct 2026 05:35:31 -0000
@@ -4,7 +4,7 @@ MODPY_DISTV = 1.1.0
DISTNAME = pcapy_ng-${MODPY_DISTV}
PKGNAME = py-pcapy-${MODPY_DISTV}
WRKDIST = ${WRKDIR}/pcapy-ng-${MODPY_DISTV}
-REVISION = 0
+REVISION = 1
HOMEPAGE = https://github.com/stamparm/pcapy-ng/
Index: patches/patch-bpfobj_cc
===================================================================
RCS file: patches/patch-bpfobj_cc
diff -N patches/patch-bpfobj_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-bpfobj_cc 27 Oct 2026 05:35:31 -0000
@@ -0,0 +1,26 @@
+Index: bpfobj.cc
+--- bpfobj.cc.orig
++++ bpfobj.cc
+@@ -193,6 +193,7 @@ p_filter(bpfobject* bpf, PyObject* args)
+ int status;
+ u_char* packet;
+ Py_ssize_t len;
++ struct pcap_pkthdr h;
+
+ if (Py_TYPE(bpf) != &BPFProgramType)
+ {
+@@ -210,9 +211,11 @@ p_filter(bpfobject* bpf, PyObject* args)
+ }
+ #endif
+
+- status = bpf_filter(bpf->bpf.bf_insns,
+- packet,
+- len, len);
++ memset(&h, 0, sizeof(h));
++ h.len = len;
++ h.caplen = len;
++
++ status = pcap_offline_filter(&bpf->bpf, &h, packet);
+
+ return Py_BuildValue("i", status);
+ }