On Tue, Oct 27, 2026 at 06:39:59AM +0100, Theo Buehler wrote:
> 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.

I will commit this tomorrow unless I hear an objection.

Index: net/py-pcapy/Makefile
===================================================================
RCS file: /cvs/ports/net/py-pcapy/Makefile,v
diff -u -p -r1.36 Makefile
--- net/py-pcapy/Makefile       11 Aug 2026 12:42:46 -0000      1.36
+++ net/py-pcapy/Makefile       27 Oct 2026 05:35:16 -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: net/py-pcapy/patches/patch-bpfobj_cc
===================================================================
RCS file: net/py-pcapy/patches/patch-bpfobj_cc
diff -N net/py-pcapy/patches/patch-bpfobj_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/py-pcapy/patches/patch-bpfobj_cc        27 Oct 2026 04:35:44 -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);
+ }

Reply via email to