]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Pass trigger_args to trunk_alloc
authorNick Porter <nick@portercomputing.co.uk>
Fri, 29 Aug 2025 17:03:20 +0000 (18:03 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 29 Aug 2025 17:03:20 +0000 (18:03 +0100)
src/lib/ldap/connection.c
src/lib/server/trunk.c
src/lib/server/trunk.h
src/lib/server/trunk_tests.c
src/modules/rlm_radius/bio.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_tacacs/rlm_tacacs_tcp.c

index 5ebb19a8272a09ac3a3a8a70a341b7bd7c02b050..fbcd793e2030c6fa61705fd4824ceacda65b34b1 100644 (file)
@@ -956,7 +956,7 @@ fr_ldap_thread_trunk_t *fr_thread_ldap_trunk_get(fr_ldap_thread_t *thread, char
                                              .request_fail = ldap_request_fail,
                                        },
                                      thread->trunk_conf,
-                                     "rlm_ldap", found, false);
+                                     "rlm_ldap", found, false, thread->trigger_args);
 
        if (!found->trunk) {
        error:
@@ -1313,7 +1313,7 @@ fr_ldap_thread_trunk_t *fr_thread_ldap_bind_trunk_get(fr_ldap_thread_t *thread)
                                              .request_fail = ldap_trunk_bind_auth_fail,
                                        },
                                       thread->bind_trunk_conf,
-                                      "rlm_ldap bind auth", ttrunk, false);
+                                      "rlm_ldap bind auth", ttrunk, false, thread->bind_trigger_args);
 
        if (!ttrunk->trunk) {
                ERROR("Unable to create LDAP connection");
index a776b6d812c82dcd4fad2874c83b1626c172476e..f10ff42eed6b391a2bd75dc92eacd403ab59c336 100644 (file)
@@ -4961,7 +4961,7 @@ static int _trunk_free(trunk_t *trunk)
  */
 trunk_t *trunk_alloc(TALLOC_CTX *ctx, fr_event_list_t *el,
                           trunk_io_funcs_t const *funcs, trunk_conf_t const *conf,
-                          char const *log_prefix, void const *uctx, bool delay_start)
+                          char const *log_prefix, void const *uctx, bool delay_start, fr_pair_list_t *trigger_args)
 {
        trunk_t *trunk;
        size_t          i;
@@ -4974,6 +4974,7 @@ trunk_t *trunk_alloc(TALLOC_CTX *ctx, fr_event_list_t *el,
        MEM(trunk = talloc_zero(ctx, trunk_t));
        trunk->el = el;
        trunk->log_prefix = talloc_strdup(trunk, log_prefix);
+       trunk->trigger_args = trigger_args;
 
        memcpy(&trunk->funcs, funcs, sizeof(trunk->funcs));
        if (!trunk->funcs.connection_prioritise) {
index 2d9c9d92eba13bc07dab124c9738898bebed5a0a..6f1466b58937e07ea2f553b7f559f2f6df5ec5d3 100644 (file)
@@ -911,9 +911,10 @@ void               trunk_connection_manage_stop(trunk_t *trunk) CC_HINT(nonnull);
 
 int            trunk_connection_manage_schedule(trunk_t *trunk) CC_HINT(nonnull);
 
-trunk_t        *trunk_alloc(TALLOC_CTX *ctx, fr_event_list_t *el,
+trunk_t                *trunk_alloc(TALLOC_CTX *ctx, fr_event_list_t *el,
                                trunk_io_funcs_t const *funcs, trunk_conf_t const *conf,
-                               char const *log_prefix, void const *uctx, bool delay_start) CC_HINT(nonnull(2, 3, 4));
+                               char const *log_prefix, void const *uctx, bool delay_start,
+                               fr_pair_list_t *trigger_args) CC_HINT(nonnull(2, 3, 4));
 /** @} */
 
 /** @name Watchers
index b8458efbbdecb2f960cf71201a4b0d64583f54c6..875682766866ce550da2d488cf7de091789593aa 100644 (file)
@@ -372,7 +372,7 @@ static trunk_t *test_setup_trunk(TALLOC_CTX *ctx, fr_event_list_t *el, trunk_con
         */
        if (with_cancel_mux) io_funcs.request_cancel_mux = test_cancel_mux;
 
-       return trunk_alloc(ctx, el, &io_funcs, conf, "test_socket_pair", uctx, false);
+       return trunk_alloc(ctx, el, &io_funcs, conf, "test_socket_pair", uctx, false, NULL);
 }
 
 static void test_socket_pair_alloc_then_free(void)
@@ -397,7 +397,7 @@ static void test_socket_pair_alloc_then_free(void)
 
        fr_timer_list_set_time_func(el->tl, test_time);
 
-       trunk = trunk_alloc(ctx, el, &io_funcs, &conf, "test_socket_pair", NULL, false);
+       trunk = trunk_alloc(ctx, el, &io_funcs, &conf, "test_socket_pair", NULL, false, NULL);
        TEST_CHECK(trunk != NULL);
        if (!trunk) return;
 
@@ -439,7 +439,7 @@ static void test_socket_pair_alloc_then_reconnect_then_free(void)
 
        fr_timer_list_set_time_func(el->tl, test_time);
 
-       trunk = trunk_alloc(ctx, el, &io_funcs, &conf, "test_socket_pair", NULL, false);
+       trunk = trunk_alloc(ctx, el, &io_funcs, &conf, "test_socket_pair", NULL, false, NULL);
        TEST_CHECK(trunk != NULL);
        if (!trunk) return;
 
@@ -528,7 +528,7 @@ static void test_socket_pair_alloc_then_connect_timeout(void)
        fr_timer_list_set_time_func(el->tl, test_time);
 
 
-       trunk = trunk_alloc(ctx, el, &io_funcs, &conf, "test_socket_pair", NULL, false);
+       trunk = trunk_alloc(ctx, el, &io_funcs, &conf, "test_socket_pair", NULL, false, NULL);
        TEST_CHECK(trunk != NULL);
        if (!trunk) return;
 
@@ -608,7 +608,7 @@ static void test_socket_pair_alloc_then_reconnect_check_delay(void)
        el = fr_event_list_alloc(ctx, NULL, NULL);
        fr_timer_list_set_time_func(el->tl, test_time);
 
-       trunk = trunk_alloc(ctx, el, &io_funcs, &conf, "test_socket_pair", NULL, false);
+       trunk = trunk_alloc(ctx, el, &io_funcs, &conf, "test_socket_pair", NULL, false, NULL);
        TEST_CHECK(trunk != NULL);
        if (!trunk) return;
 
index 6d7179322f33c86749f768a1f4e528b861758738..e81346458b1fce452d59ab764934c1a886465f9e 100644 (file)
@@ -2702,7 +2702,7 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
                }
 
                thread->ctx.trunk = trunk_alloc(thread, mctx->el, &io_funcs,
-                                           &inst->trunk_conf, inst->name, thread, false);
+                                           &inst->trunk_conf, inst->name, thread, false, inst->trigger_args);
                if (!thread->ctx.trunk) return -1;
                return 0;
 
@@ -2713,7 +2713,7 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
                if (inst->fd_config.socket_type == SOCK_DGRAM) break;
 
                thread->ctx.trunk = trunk_alloc(thread, mctx->el, &io_replicate_funcs,
-                                               &inst->trunk_conf, inst->name, thread, false);
+                                               &inst->trunk_conf, inst->name, thread, false, inst->trigger_args);
                if (!thread->ctx.trunk) return -1;
                return 0;
 
@@ -2976,7 +2976,7 @@ static xlat_action_t xlat_radius_client(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcurso
                 *      Allocate the trunk and start it up.
                 */
                home->ctx.trunk = trunk_alloc(home, unlang_interpret_event_list(request), &io_funcs,
-                                             &inst->trunk_conf, inst->name, home, false);
+                                             &inst->trunk_conf, inst->name, home, false, inst->trigger_args);
                if (!home->ctx.trunk) {
                fail:
                        talloc_free(home);
index 2b9838d6904b4a488a9f306235546a66a0c9d584..e8fec973665bef6e01d9c99496ba1ea8c07d2dd7 100644 (file)
@@ -2408,7 +2408,7 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
        t->inst = inst;
 
        t->trunk = trunk_alloc(t, mctx->el, &inst->driver->trunk_io_funcs,
-                                 &inst->config.trunk_conf, inst->name, t, false);
+                              &inst->config.trunk_conf, inst->name, t, false, inst->trigger_args);
        if (!t->trunk) return -1;
 
        return 0;
index 29d35c338720ede69576fa8b477937094a9c5e88..6d88be9981d121dd38e1a24c4d80a2f1164ce241 100644 (file)
@@ -1463,7 +1463,7 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
        thread->el = mctx->el;
        thread->inst = inst;
        thread->trunk = trunk_alloc(thread, mctx->el, &io_funcs,
-                                   &inst->parent->trunk_conf, inst->parent->name, thread, false);
+                                   &inst->parent->trunk_conf, inst->parent->name, thread, false, inst->trigger_args);
        if (!thread->trunk) return -1;
 
        return 0;