]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
simplify dynamic client config a bit
authorAlan T. DeKok <aland@freeradius.org>
Wed, 28 Jun 2023 13:20:02 +0000 (09:20 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 28 Jun 2023 13:31:28 +0000 (09:31 -0400)
src/lib/server/process.h
src/process/radius/base.c

index 5128e8690a725f1f4a2df95c49a506546739914d..b4b81604f615e58238156edb6b693c4d99a4a05f 100644 (file)
@@ -445,6 +445,27 @@ static inline unlang_action_t new_client(rlm_rcode_t *p_result, module_ctx_t con
                                              cs, RLM_MODULE_FAIL, resume_new_client,
                                              NULL, 0, mctx->rctx);
 }
+
+#define DYNAMIC_CLIENT_SECTIONS \
+       { \
+               .name = "new", \
+               .name2 = "client", \
+               .component = MOD_AUTHORIZE, \
+               .offset = PROCESS_CONF_OFFSET(new_client), \
+       }, \
+       { \
+               .name = "add", \
+               .name2 = "client", \
+               .component = MOD_AUTHORIZE, \
+               .offset = PROCESS_CONF_OFFSET(add_client), \
+       }, \
+       { \
+               .name = "deny", \
+               .name2 = "client", \
+               .component = MOD_AUTHORIZE, \
+               .offset = PROCESS_CONF_OFFSET(deny_client), \
+       }
+
 #endif /* PROCESS_DYNAMIC_CLIENT */
 
 #endif /* defined(PROCESS_INST) && defined(PROCESS_PACKET_TYPE) && defined(PROCESS_PACKET_CODE_VALID) */
index b90ddb9a8d17f50e01ae78307f8eba7ff7a526aa..c35d8653cbf27b588879a8f0b6912df68e153c2d 100644 (file)
@@ -1281,24 +1281,8 @@ static virtual_server_compile_t const compile_list[] = {
                .component = MOD_AUTHENTICATE
        },
 
-       {
-               .name = "new",
-               .name2 = "client",
-               .component = MOD_AUTHORIZE,
-               .offset = PROCESS_CONF_OFFSET(new_client),
-       },
-       {
-               .name = "add",
-               .name2 = "client",
-               .component = MOD_AUTHORIZE,
-               .offset = PROCESS_CONF_OFFSET(add_client),
-       },
-       {
-               .name = "deny",
-               .name2 = "client",
-               .component = MOD_AUTHORIZE,
-               .offset = PROCESS_CONF_OFFSET(deny_client),
-       },
+       DYNAMIC_CLIENT_SECTIONS,
+
        COMPILE_TERMINATOR
 };