]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add trigger_args to rlm_radius
authorNick Porter <nick@portercomputing.co.uk>
Fri, 29 Aug 2025 16:50:06 +0000 (17:50 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 29 Aug 2025 16:50:06 +0000 (17:50 +0100)
src/modules/rlm_radius/rlm_radius.c
src/modules/rlm_radius/rlm_radius.h

index 5cb4d67e6c47c98d86a0dc9a5f473fd7da96f09d..856f986aac4071fbae8de9775ecda7a9d5e51cc3 100644 (file)
@@ -931,6 +931,29 @@ check_others:
        inst->trunk_conf.req_pool_headers = 4;  /* One for the request, one for the buffer, one for the tracking binding, one for Proxy-State VP */
        inst->trunk_conf.req_pool_size = 1024 + sizeof(fr_pair_t) + 20;
 
+       if (inst->trunk_conf.conn_triggers) {
+               module_trigger_args_t   args;
+               char                    *server = NULL;
+
+               args = (module_trigger_args_t) {
+                       .module = mctx->mi->module->name,
+                       .name = inst->name
+               };
+
+               /*
+                *      Only client and proxy mode have fixed destinations
+                */
+               if ((inst->mode == RLM_RADIUS_MODE_CLIENT) || (inst->mode == RLM_RADIUS_MODE_PROXY)) {
+                       fr_value_box_aprint(inst, &server, fr_box_ipaddr(inst->fd_config.dst_ipaddr), NULL);
+                       args.server = server;
+                       args.port = inst->fd_config.dst_port;
+               }
+
+               MEM(inst->trigger_args = fr_pair_list_alloc(inst));
+               if (module_trigger_args_build(inst->trigger_args, inst->trigger_args,
+                                             cf_section_find(conf, "pool", NULL), &args) < 0) return -1;
+       }
+
        /*
         *      Only check the async timers when we're acting as a client.
         */
index 2d9a28bc8bfca22f0853f8fbf26a4b3c6566d5be..4ae4def7fb70e8253a4b92ed35db887f9a456206 100644 (file)
@@ -92,4 +92,6 @@ struct rlm_radius_s {
        fr_retry_config_t       retry[FR_RADIUS_CODE_MAX];
 
        trunk_conf_t            trunk_conf;             //!< trunk configuration
+
+       fr_pair_list_t          *trigger_args;          //!< Pairs passed to trigger requests.
 };