From f53bffb15689513a64bc138972fd5c2fd5ec91ee Mon Sep 17 00:00:00 2001 From: Ka Ho Ng Date: Wed, 3 Sep 2025 18:47:27 +0000 Subject: [PATCH] IfAPI: fix LINT-NOIP build Also, reimplement the wrappers with __strong_reference macro. Fixes: 7b3094df479f Reported by: zlei Sponsored by: Juniper Networks, Inc. Reviewed by: zlei, jhibbits Differential Revision: https://reviews.freebsd.org/D52362 --- sys/net/bpf.c | 2 ++ sys/net/if.c | 12 ------------ sys/net/if_ethersubr.c | 2 ++ 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index de56f3db782..a5222c3659c 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -3223,6 +3223,8 @@ bpf_validate(const struct bpf_insn *f, int len) #endif /* !DEV_BPF && !NETGRAPH_BPF */ +__strong_reference(bpf_mtap_if, if_bpfmtap); + #ifdef DDB static void bpf_show_bpf_if(struct bpf_if *bpf_if) diff --git a/sys/net/if.c b/sys/net/if.c index a3fb237e3f9..f308edd2473 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4866,18 +4866,6 @@ 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_ethersubr.c b/sys/net/if_ethersubr.c index 551a1e33584..990f8605c8c 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1551,5 +1551,7 @@ ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr) ether_gen_addr_byname(if_name(ifp), hwaddr); } +__strong_reference(ether_bpf_mtap_if, if_etherbpfmtap); + DECLARE_MODULE(ether, ether_mod, SI_SUB_INIT_IF, SI_ORDER_ANY); MODULE_VERSION(ether, 1);