From b4e8a93817193379bfa047db06a860854710763f Mon Sep 17 00:00:00 2001 From: dlg Date: Sat, 20 Feb 2021 04:35:41 +0000 Subject: [PATCH] give interfaces an if_bpf_mtap handler. the network stack is now responsible for calling bpf for packets that the interface receives, and we so far got away with using bpf_mtap_ether for everything. this doesn't work if layer 3 input goes through the same functions, so letting drivers specify the appropriate bpf mtap function means they will be able to cope. --- sys/net/if_var.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 2de907c7a7f..26c08284f0d 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_var.h,v 1.112 2020/07/29 12:09:31 mvs Exp $ */ +/* $OpenBSD: if_var.h,v 1.113 2021/02/20 04:35:41 dlg Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -161,6 +161,7 @@ struct ifnet { /* and the entries */ /* procedure handles */ void (*if_input)(struct ifnet *, struct mbuf *); + int (*if_bpf_mtap)(caddr_t, const struct mbuf *, u_int); int (*if_output)(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); /* output routine (enqueue) */ /* link level output function */ -- 2.20.1