aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce M Simpson <bms@FreeBSD.org>2026-07-30 15:53:11 +0000
committerBruce M Simpson <bms@FreeBSD.org>2026-08-03 11:27:44 +0000
commit4a59a0cf99bb9a48ccea62e9499186e892cf51bc (patch)
treef4222bf9dcb091e1a55d36ace3fa1c7fba73c8d0
parentc9df1a6cf9be9d44eacc8616ebba1cd19010c7fc (diff)
netinet6: Add a definition of struct ip6_hdr_pseudo{} for OCF compatibility.
This change is intended to address @glebius comments from the original D55663. ip6_hdr_pseudo{} is referenced by certain OpenBSD OCF related components. I am using __aligned(4) and not __packed as urged by the late Hans-Petter Selasky. Use C99 types and style. We must eat the churn now cross-BSD compatibility is "Fade to Black". Put _Static_assert under #ifdef INVARIANTS to not disrupt regular compilation, as this resides in a commonly included header file.
-rw-r--r--sys/netinet6/ip6_var.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index 9a861ab20647..769a254cdf52 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -66,6 +66,24 @@
#include <sys/epoch.h>
#ifdef _KERNEL
+/*
+ * For IPv6 pseudo header checksum; to be used by TCP-MD5,
+ * and for OCF source level compatibility with OpenBSD.
+ */
+struct ip6_hdr_pseudo {
+ struct in6_addr ip6ph_src;
+ struct in6_addr ip6ph_dst;
+ uint32_t ip6ph_len;
+ uint8_t ip6ph_zero[3];
+ uint8_t ip6ph_nxt;
+} __aligned(4);
+
+#ifdef INVARIANTS
+/* Aligned size of pseudo-header must equal size of IPv6 header. */
+_Static_assert(sizeof(struct ip6_hdr_pseudo) == 40,
+ "IPv6 pseudo-header alignment failure");
+#endif
+
struct ip6asfrag; /* frag6.c */
TAILQ_HEAD(ip6fraghead, ip6asfrag);