git: 4bccbf03d81b - main - routing: allow logging framework to be used outside of the subsystem

From: Alexander V. Chernikov <melifaro_at_FreeBSD.org>
Date: Mon, 05 Sep 2022 10:46:07 UTC
The branch main has been updated by melifaro:

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

commit 4bccbf03d81b2bafb93c1674eaa2f70e7226a25a
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2022-09-05 10:44:27 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2022-09-05 10:44:27 +0000

    routing: allow logging framework to be used outside of the subsystem
    
    MFC after:      2 weeks
---
 sys/net/route/route_debug.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sys/net/route/route_debug.h b/sys/net/route/route_debug.h
index b7c8c79f7ffa..5be39a53076e 100644
--- a/sys/net/route/route_debug.h
+++ b/sys/net/route/route_debug.h
@@ -35,10 +35,14 @@
 #include <sys/sysctl.h>
 #include <sys/syslog.h>
 
-
 /* DEBUG logic */
 #if defined(DEBUG_MOD_NAME) && defined(DEBUG_MAX_LEVEL)
 
+#ifndef	_DEBUG_SYSCTL_OID
+#define	_DEBUG_SYSCTL_OID	_net_route_debug
+SYSCTL_DECL(_net_route_debug);
+#endif
+
 #define DEBUG_VAR_NAME                  	_DEBUG_VAR_NAME(DEBUG_MOD_NAME)
 #define _DEBUG_VAR_NAME(a)			_DEBUG_VAR_NAME_INDIRECT(a)
 #define _DEBUG_VAR_NAME_INDIRECT(prefix)	prefix##_debug_level
@@ -48,9 +52,8 @@
 #define __DEBUG_PREFIX_NAME(n)			#n
 
 #define	_DECLARE_DEBUG(_default_level)  	        		\
-	SYSCTL_DECL(_net_route_debug);					\
 	static int DEBUG_VAR_NAME = _default_level;	                \
-        SYSCTL_INT(_net_route_debug, OID_AUTO, DEBUG_VAR_NAME,          \
+        SYSCTL_INT(_DEBUG_SYSCTL_OID, OID_AUTO, DEBUG_VAR_NAME,          \
 		CTLFLAG_RW | CTLFLAG_RWTUN,				\
                 &(DEBUG_VAR_NAME), 0, "debuglevel")