summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2021-02-20 04:37:27 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2021-02-20 04:37:27 +0000
commit1853b72e8295f6a558b22c4d8c5e4f04f88dcbca (patch)
tree8fe908acfbe75c4e03ad4c62058587e5dc52d1f3 /sys/net
parent4fa044574046b00d670119ebd772dc69423ed772 (diff)
default interfaces to bpf_mtap_ether for their if_bpf_mtap handler.
call (*ifp->if_bpf_mtap) instead of bpf_mtap_ether in ifiq_input and if_vinput.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c8
-rw-r--r--sys/net/ifq.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 6e01d40fdd7..9377bda5b44 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.630 2021/02/20 01:11:43 dlg Exp $ */
+/* $OpenBSD: if.c,v 1.631 2021/02/20 04:37:26 dlg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -629,6 +629,10 @@ if_attach_common(struct ifnet *ifp)
ifp->if_rtrequest = if_rtrequest_dummy;
if (ifp->if_enqueue == NULL)
ifp->if_enqueue = if_enqueue_ifq;
+#if NBPFILTER > 0
+ if (ifp->if_bpf_mtap == NULL)
+ ifp->if_bpf_mtap = bpf_mtap_ether;
+#endif
ifp->if_llprio = IFQ_DEFPRIO;
}
@@ -852,7 +856,7 @@ if_vinput(struct ifnet *ifp, struct mbuf *m)
#if NBPFILTER > 0
if_bpf = ifp->if_bpf;
if (if_bpf) {
- if (bpf_mtap_ether(if_bpf, m, BPF_DIRECTION_IN)) {
+ if ((*ifp->if_bpf_mtap)(if_bpf, m, BPF_DIRECTION_IN)) {
m_freem(m);
return;
}
diff --git a/sys/net/ifq.c b/sys/net/ifq.c
index 1aa126f614f..51eaaf44343 100644
--- a/sys/net/ifq.c
+++ b/sys/net/ifq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifq.c,v 1.42 2021/02/20 01:11:44 dlg Exp $ */
+/* $OpenBSD: ifq.c,v 1.43 2021/02/20 04:37:26 dlg Exp $ */
/*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
@@ -693,7 +693,7 @@ ifiq_input(struct ifiqueue *ifiq, struct mbuf_list *ml)
ml_init(ml);
while ((m = ml_dequeue(&ml0)) != NULL) {
- if (bpf_mtap_ether(if_bpf, m, BPF_DIRECTION_IN))
+ if ((*ifp->if_bpf_mtap)(if_bpf, m, BPF_DIRECTION_IN))
m_freem(m);
else
ml_enqueue(ml, m);