From c63ca22395f51f4cfb6991f1740cca03dfe585d2 Mon Sep 17 00:00:00 2001 From: Ka Ho Ng Date: Wed, 3 Sep 2025 17:59:01 +0000 Subject: [PATCH] IfAPI: restore KBI after bceb9c2f2b19 This commit restores if_bpfmtap and if_etherbpfmtap functions, and implement them as wrappers around bpf_mtap_if and ether_bpf_mtap_if funcitons. Fixes: bceb9c2f2b19 Sponsored by: Juniper Networks, Inc. --- sys/net/if.c | 12 ++++++++++++ sys/net/if_var.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index f308edd2473..a3fb237e3f9 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4866,6 +4866,18 @@ if_gethandle(u_char type) return (if_alloc(type)); } +void +if_bpfmtap(if_t ifp, struct mbuf *m) +{ + bpf_mtap_if(ifp, m); +} + +void +if_etherbpfmtap(if_t ifp, struct mbuf *m) +{ + ether_bpf_mtap_if(ifp, m); +} + void if_vlancap(if_t ifp) { diff --git a/sys/net/if_var.h b/sys/net/if_var.h index b8a0b3d3fcd..74692e91655 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -629,6 +629,8 @@ int if_vlantrunkinuse(if_t ifp); caddr_t if_getlladdr(const if_t ifp); struct vnet *if_getvnet(const if_t ifp); void *if_gethandle(u_char); +void if_bpfmtap(if_t ifp, struct mbuf *m); +void if_etherbpfmtap(if_t ifp, struct mbuf *m); void if_vlancap(if_t ifp); int if_transmit(if_t ifp, struct mbuf *m); void if_init(if_t ifp, void *ctx);