git: 8f19f3d31a72 - main - ipfilter: Fix struct ifnet pointer type
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 13 Dec 2021 14:25:36 UTC
The branch main has been updated by cy:
URL: https://cgit.FreeBSD.org/src/commit/?id=8f19f3d31a7224c502c36dd16f1321b802e4da60
commit 8f19f3d31a7224c502c36dd16f1321b802e4da60
Author: Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-12-12 23:57:36 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-12-13 14:24:50 +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.
MFC after: 1 week
---
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 7e976d88cc0f..a01bd28e7270 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 */