Index: ifq.c =================================================================== RCS file: /cvs/src/sys/net/ifq.c,v diff -u -p -r1.58 ifq.c --- ifq.c 2 Mar 2025 21:28:32 -0000 1.58 +++ ifq.c 3 Mar 2025 12:18:54 -0000 @@ -663,6 +663,7 @@ void ifiq_init(struct ifiqueue *ifiq, struct ifnet *ifp, unsigned int idx) { ifiq->ifiq_if = ifp; + ifiq->ifiq_bpfp = NULL; ifiq->ifiq_softnet = net_tq(idx); ifiq->ifiq_softc = NULL; @@ -719,7 +720,7 @@ ifiq_input(struct ifiqueue *ifiq, struct uint64_t fdrops = 0; unsigned int len; #if NBPFILTER > 0 - caddr_t if_bpf; + caddr_t *ifiq_bpfp, ifiq_bpf = NULL, if_bpf; #endif if (ml_empty(ml)) @@ -733,14 +734,22 @@ ifiq_input(struct ifiqueue *ifiq, struct packets = ml_len(ml); #if NBPFILTER > 0 - if_bpf = ifp->if_bpf; - if (if_bpf) { + ifiq_bpfp = READ_ONCE(ifiq->ifiq_bpfp); + if (ifiq_bpfp != NULL) + ifiq_bpf = READ_ONCE(*ifiq_bpfp); + if_bpf = READ_ONCE(ifp->if_bpf); + if (ifiq_bpf || if_bpf) { struct mbuf_list ml0 = *ml; ml_init(ml); while ((m = ml_dequeue(&ml0)) != NULL) { - if ((*ifp->if_bpf_mtap)(if_bpf, m, BPF_DIRECTION_IN)) { + int drop = 0; + if ((*ifp->if_bpf_mtap)(ifiq_bpf, m, BPF_DIRECTION_IN)) + drop = 1; + if ((*ifp->if_bpf_mtap)(if_bpf, m, BPF_DIRECTION_IN)) + drop = 1; + if (drop) { m_freem(m); fdrops++; } else Index: ifq.h =================================================================== RCS file: /cvs/src/sys/net/ifq.h,v diff -u -p -r1.43 ifq.h --- ifq.h 3 Feb 2025 08:58:52 -0000 1.43 +++ ifq.h 3 Mar 2025 12:18:54 -0000 @@ -75,6 +75,7 @@ struct ifqueue { struct ifiqueue { struct ifnet *ifiq_if; + caddr_t *ifiq_bpfp; struct taskq *ifiq_softnet; union { void *_ifiq_softc;