git: 122dd78c143e - main - sys/netipsec: fix IPSEC_SUPPORT for non-INET kernels

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 12 Apr 2024 16:52:53 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=122dd78c143e3d138b5d503a30da4c326f41002a

commit 122dd78c143e3d138b5d503a30da4c326f41002a
Author:     Lexi Winter <lexi@le-Fay.ORG>
AuthorDate: 2024-04-12 16:30:20 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-12 16:30:22 +0000

    sys/netipsec: fix IPSEC_SUPPORT for non-INET kernels
    
    The functions ipsec_kmod_udp_input() and ipsec_kmod_udp_pcbctl() are
    used by netinet6 for IPSEC_SUPPORT, but are guarded behind #ifdef INET.
    
    Since neither of these require INET, remove the guard so they're built
    even without INET.
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1158
---
 sys/netipsec/subr_ipsec.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/sys/netipsec/subr_ipsec.c b/sys/netipsec/subr_ipsec.c
index ce874bcd57b5..a1eb8f220525 100644
--- a/sys/netipsec/subr_ipsec.c
+++ b/sys/netipsec/subr_ipsec.c
@@ -328,6 +328,15 @@ static struct ipsec_support ipv4_ipsec = {
 	.methods = NULL
 };
 struct ipsec_support * const ipv4_ipsec_support = &ipv4_ipsec;
+#endif
+
+#ifdef INET6
+static struct ipsec_support ipv6_ipsec = {
+	.enabled = 0,
+	.methods = NULL
+};
+struct ipsec_support * const ipv6_ipsec_support = &ipv6_ipsec;
+#endif
 
 IPSEC_KMOD_METHOD(int, ipsec_kmod_udp_input, sc,
     udp_input, METHOD_DECL(struct ipsec_support * const sc, struct mbuf *m,
@@ -338,15 +347,6 @@ IPSEC_KMOD_METHOD(int, ipsec_kmod_udp_pcbctl, sc,
     udp_pcbctl, METHOD_DECL(struct ipsec_support * const sc, struct inpcb *inp,
 	struct sockopt *sopt), METHOD_ARGS(inp, sopt)
 )
-#endif
-
-#ifdef INET6
-static struct ipsec_support ipv6_ipsec = {
-	.enabled = 0,
-	.methods = NULL
-};
-struct ipsec_support * const ipv6_ipsec_support = &ipv6_ipsec;
-#endif
 
 IPSEC_KMOD_METHOD(int, ipsec_kmod_input, sc,
     input, METHOD_DECL(struct ipsec_support * const sc, struct mbuf *m,