From: Nick Porter Date: Thu, 21 Aug 2025 18:17:17 +0000 (+0100) Subject: Add CONF_SECTION for trunk connection / request triggers X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11a93fa7ef6ea85644e9787ee7a750ffb1ef4bfd;p=thirdparty%2Ffreeradius-server.git Add CONF_SECTION for trunk connection / request triggers So modules using trunks can have their own trigger sections. --- diff --git a/src/lib/server/trunk.c b/src/lib/server/trunk.c index fa2f04ff6b..dec0927f5f 100644 --- a/src/lib/server/trunk.c +++ b/src/lib/server/trunk.c @@ -435,7 +435,7 @@ static size_t trunk_connection_events_len = NUM_ELEMENTS(trunk_connection_events #define CONN_TRIGGER(_state) do { \ if (trunk->conf.conn_triggers) { \ trigger(unlang_interpret_get_thread_default(), \ - NULL, fr_table_str_by_value(trunk_conn_trigger_names, _state, \ + trunk->conf.conn_trigger_cs, fr_table_str_by_value(trunk_conn_trigger_names, _state, \ ""), true, NULL); \ } \ } while (0) @@ -466,7 +466,7 @@ void trunk_request_state_log_entry_add(char const *function, int line, #define REQUEST_TRIGGER(_state) do { \ if (trunk->conf.req_triggers) { \ trigger(unlang_interpret_get_thread_default(), \ - NULL, fr_table_str_by_value(trunk_req_trigger_names, _state, \ + trunk->conf.req_trigger_cs, fr_table_str_by_value(trunk_req_trigger_names, _state, \ ""), true, NULL); \ } \ } while (0) diff --git a/src/lib/server/trunk.h b/src/lib/server/trunk.h index 57ee9ba5b0..2d9c9d92eb 100644 --- a/src/lib/server/trunk.h +++ b/src/lib/server/trunk.h @@ -283,8 +283,10 @@ typedef struct { //!< was a failure, instead of failing them immediately. bool conn_triggers; //!< Do we run connection related triggers? + CONF_SECTION *conn_trigger_cs; //!< Module conf section to find connection trigger section in. bool req_triggers; //!< Do we run request related triggers? + CONF_SECTION *req_trigger_cs; //!< Module conf section to find request trigger section in. } trunk_conf_t; /** Public fields for the trunk