git: 7b3094df479f - stable/14 - IfAPI: restore KBI after bceb9c2f2b19

From: Ka Ho Ng <khng_at_FreeBSD.org>
Date: Wed, 03 Sep 2025 18:05:40 UTC
The branch stable/14 has been updated by khng:

URL: https://cgit.FreeBSD.org/src/commit/?id=7b3094df479fd820eb7a2bd3948619a9eaf77665

commit 7b3094df479fd820eb7a2bd3948619a9eaf77665
Author:     Ka Ho Ng <khng@FreeBSD.org>
AuthorDate: 2025-09-03 17:59:01 +0000
Commit:     Ka Ho Ng <khng@FreeBSD.org>
CommitDate: 2025-09-03 18:04:07 +0000

    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 f308edd24734..a3fb237e3f96 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 b8a0b3d3fcd1..74692e916558 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);