git: 4e4c7b835aa8 - main - if_wg: Prefix crypto_init() & crypto_deinit() with wg_ for a cleaner namespace.

Bruce M Simpson <[email protected]> Mon, 03 Aug 2026 11:28:40 +0000
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a707b68.188cb.4bdd1274__47863.6751113058$1785756585$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by bms:

URL: https://cgit.FreeBSD.org/src/commit/?id=4e4c7b835aa814a056972e697ac41a9cbfc54a63

commit 4e4c7b835aa814a056972e697ac41a9cbfc54a63
Author:     Bruce M Simpson <[email protected]>
AuthorDate: 2026-08-01 18:35:02 +0000
Commit:     Bruce M Simpson <[email protected]>
CommitDate: 2026-08-03 11:27:45 +0000

    if_wg: Prefix crypto_init() & crypto_deinit() with wg_ for a cleaner namespace.
    
    Both these functions have non-static linkage for good reasons, however, their
    naming may confuse folk when working with crypto(9) code at global scope.
---
 sys/dev/wg/crypto.h    | 4 ++--
 sys/dev/wg/if_wg.c     | 4 ++--
 sys/dev/wg/wg_crypto.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/dev/wg/crypto.h b/sys/dev/wg/crypto.h
index ff7b39354749..4e2648d61c80 100644
--- a/sys/dev/wg/crypto.h
+++ b/sys/dev/wg/crypto.h
@@ -14,8 +14,8 @@
 
 struct mbuf;
 
-int crypto_init(void);
-void crypto_deinit(void);
+int wg_crypto_init(void);
+void wg_crypto_deinit(void);
 
 enum chacha20poly1305_lengths {
 	XCHACHA20POLY1305_NONCE_SIZE = 24,
diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c
index 611314883643..ffae47938e0a 100644
--- a/sys/dev/wg/if_wg.c
+++ b/sys/dev/wg/if_wg.c
@@ -3241,7 +3241,7 @@ wg_module_init(void)
 	wg_packet_zone = uma_zcreate("wg packet", sizeof(struct wg_packet),
 	     NULL, NULL, NULL, NULL, 0, 0);
 
-	ret = crypto_init();
+	ret = wg_crypto_init();
 	if (ret != 0)
 		return (ret);
 	ret = cookie_init();
@@ -3274,7 +3274,7 @@ wg_module_deinit(void)
 	if (wg_osd_jail_slot != 0)
 		osd_jail_deregister(wg_osd_jail_slot);
 	cookie_deinit();
-	crypto_deinit();
+	wg_crypto_deinit();
 	if (wg_packet_zone != NULL)
 		uma_zdestroy(wg_packet_zone);
 }
diff --git a/sys/dev/wg/wg_crypto.c b/sys/dev/wg/wg_crypto.c
index 82b80c7fd451..f70c0091c445 100644
--- a/sys/dev/wg/wg_crypto.c
+++ b/sys/dev/wg/wg_crypto.c
@@ -265,7 +265,7 @@ chacha20poly1305_decrypt_mbuf(struct mbuf *m, const uint64_t nonce,
 }
 
 int
-crypto_init(void)
+wg_crypto_init(void)
 {
 	struct crypto_session_params csp = {
 		.csp_mode = CSP_MODE_AEAD,
@@ -286,7 +286,7 @@ crypto_init(void)
 }
 
 void
-crypto_deinit(void)
+wg_crypto_deinit(void)
 {
 	crypto_freesession(chacha20_poly1305_sid);
 }