git: 3c937e88d7ca - stable/13 - ipfilter: Fix struct ifnet pointer type
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 21 Dec 2021 23:35:26 UTC
The branch stable/13 has been updated by cy:
URL: https://cgit.FreeBSD.org/src/commit/?id=3c937e88d7caea9be0122de2823c537d28e30160
commit 3c937e88d7caea9be0122de2823c537d28e30160
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:34:41 +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 */