git: 6023bd1d52b6 - main - netipsec: move declaration of the sysctl net.inet{,6}.ipsec nodes to header

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 21 Jul 2024 08:53:45 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=6023bd1d52b6b928927f9d2c0e3017687b29a731

commit 6023bd1d52b6b928927f9d2c0e3017687b29a731
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-07-19 19:14:41 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-07-21 08:53:19 +0000

    netipsec: move declaration of the sysctl net.inet{,6}.ipsec nodes to header
    
    Reviewed by:    kp
    Sponsored by:   NVIDIA networking
    Differential revision:  https://reviews.freebsd.org/D46045
---
 sys/netipsec/ipsec.c | 4 ----
 sys/netipsec/ipsec.h | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c
index e22a3872d48d..9b18cedc7a80 100644
--- a/sys/netipsec/ipsec.c
+++ b/sys/netipsec/ipsec.c
@@ -172,8 +172,6 @@ VNET_DEFINE(int, natt_cksum_policy) = 0;
 FEATURE(ipsec, "Internet Protocol Security (IPsec)");
 FEATURE(ipsec_natt, "UDP Encapsulation of IPsec ESP Packets ('NAT-T')");
 
-SYSCTL_DECL(_net_inet_ipsec);
-
 /* net.inet.ipsec */
 SYSCTL_PROC(_net_inet_ipsec, IPSECCTL_DEF_POLICY, def_policy,
     CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
@@ -257,8 +255,6 @@ VNET_DEFINE(int, ip6_ipsec_ecn) = 0;	/* ECN ignore(-1)/forbidden(0)/allowed(1) *
 VNET_DEFINE_STATIC(int, ip6_filtertunnel) = 0;
 #define	V_ip6_filtertunnel	VNET(ip6_filtertunnel)
 
-SYSCTL_DECL(_net_inet6_ipsec6);
-
 /* net.inet6.ipsec6 */
 SYSCTL_PROC(_net_inet6_ipsec6, IPSECCTL_DEF_POLICY, def_policy,
     CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h
index dfb334601331..749813518092 100644
--- a/sys/netipsec/ipsec.h
+++ b/sys/netipsec/ipsec.h
@@ -46,6 +46,7 @@
 #include <sys/_lock.h>
 #include <sys/_mutex.h>
 #include <sys/_rwlock.h>
+#include <sys/sysctl.h>
 
 #define	IPSEC_ASSERT(_c,_m) KASSERT(_c, _m)
 
@@ -359,6 +360,9 @@ struct mbuf *m_makespace(struct mbuf *m0, int skip, int hlen, int *off);
 caddr_t m_pad(struct mbuf *m, int n);
 int m_striphdr(struct mbuf *m, int skip, int hlen);
 
+SYSCTL_DECL(_net_inet_ipsec);
+SYSCTL_DECL(_net_inet6_ipsec6);
+
 #endif /* _KERNEL */
 
 #ifndef _KERNEL