git: 616a2e8312fd - stable/12 - ipfilter: Fix struct ifnet pointer type

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Tue, 21 Dec 2021 23:38:03 UTC
The branch stable/12 has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=616a2e8312fd167473202e18b8771f6902b2f45b

commit 616a2e8312fd167473202e18b8771f6902b2f45b
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-12-12 23:57:36 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-12-21 23:37:25 +0000

    ipfilter: Fix struct ifnet pointer type
    
    The fr_info struct contains a summary of a packet. One of its fields
    is a pointer to the ifnet struct the packet arrived on. It is pointed
    to by a void* because ipfilter supports multiple O/Ses. Unfortunately
    this makes it difficult it examine with DTrace. Defining fin_ifp as a
    pointer to an ifnet struct makes the struct it points to using a DTrace
    script possible.
    
    (cherry picked from commit 8f19f3d31a7224c502c36dd16f1321b802e4da60)
---
 sys/contrib/ipfilter/netinet/ip_fil.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h
index 8cb988e1fd17..be8e023ac0ba 100644
--- a/sys/contrib/ipfilter/netinet/ip_fil.h
+++ b/sys/contrib/ipfilter/netinet/ip_fil.h
@@ -358,7 +358,11 @@ typedef enum ipf_cksum_e {
 
 typedef	struct	fr_info	{
 	void	*fin_main_soft;
+#ifdef __FreeBSD__
+	struct ifnet	*fin_ifp;	/* interface packet is `on' */
+#else
 	void	*fin_ifp;		/* interface packet is `on' */
+#endif
 	struct	frentry *fin_fr;	/* last matching rule */
 	int	fin_out;		/* in or out ? 1 == out, 0 == in */
 	fr_ip_t	fin_fi;			/* IP Packet summary */