]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
tmpl_push should take an argument saying whether it's a top frame
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 21 Jul 2025 15:02:54 +0000 (08:02 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 21 Jul 2025 21:55:42 +0000 (14:55 -0700)
15 files changed:
src/lib/server/trigger.c
src/lib/unlang/call_env.c
src/lib/unlang/edit.c
src/lib/unlang/limit.c
src/lib/unlang/map.c
src/lib/unlang/module.c
src/lib/unlang/timeout.c
src/lib/unlang/tmpl.c
src/lib/unlang/tmpl.h
src/lib/unlang/xlat_eval.c
src/modules/rlm_ldap/groups.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_sqlippool/rlm_sqlippool.c

index c6c0d887aedd74beee9a75532c3969377e019798..811aa857edd81d7dd2660808a82310b408fcab50 100644 (file)
@@ -103,15 +103,6 @@ typedef struct {
        int                     exec_status;    //!< Result of the program (if the trigger is a tmpl)
 } fr_trigger_t;
 
-/*
- *     Function to call when popping the frame
- */
-static unlang_action_t trigger_pop(UNUSED unlang_result_t *p_result, UNUSED request_t *request, UNUSED void *uctx)
-{
-       return UNLANG_ACTION_CALCULATE_RESULT;
-}
-
-
 /** Execute a trigger - call an executable to process an event
  *
  * A trigger ties a state change (e.g. connection up) in a module to an action
@@ -165,8 +156,6 @@ int trigger(unlang_interpret_t *intp,
        fr_event_list_t         *el;
        tmpl_rules_t            t_rules;
 
-       unlang_action_t         action;
-
        /*
         *      noop if trigger_init was never called, or if
         *      we're just checking the configuration.
@@ -334,19 +323,6 @@ int trigger(unlang_interpret_t *intp,
 
        fr_assert(trigger->vpt != NULL);
 
-       action = unlang_function_push_with_result(unlang_interpret_result(request),     /* transparent */
-                                                 request,
-                                                 NULL,                                 /* don't call it immediately */
-                                                 trigger_pop,                          /* but when we pop the frame */
-                                                 NULL, ~(FR_SIGNAL_CANCEL),
-                                                 UNLANG_TOP_FRAME,
-                                                 NULL);
-       if (action != UNLANG_ACTION_PUSHED_CHILD) {
-               ERROR("Failed initializing the trigger");
-               talloc_free(request);
-               return -1;
-       }
-
        if (unlang_tmpl_push(trigger, &trigger->result, &trigger->out, request, trigger->vpt,
                             &(unlang_tmpl_args_t) {
                                .type = UNLANG_TMPL_ARGS_TYPE_EXEC,
@@ -354,7 +330,7 @@ int trigger(unlang_interpret_t *intp,
                                        .status_out = &trigger->exec_status,
                                        .timeout = fr_time_delta_from_sec(5),
                                        },
-                            }) < 0) {
+                            }, UNLANG_TOP_FRAME) < 0) {
                talloc_free(request);
        }
 
index 80f50e5b56e9fad08d7828869167f6848e51d8a1..57faf3db5dc01a27d3fa50f2ab0c297a8c4bb8ea 100644 (file)
@@ -258,7 +258,7 @@ again:
 
        if (unlang_tmpl_push(ctx, &call_env_rctx->expansion_result, &call_env_rctx->tmpl_expanded, request,
                             call_env_rctx->last_expanded->data.tmpl,
-                            NULL) < 0) return UNLANG_ACTION_FAIL;
+                            NULL, UNLANG_SUB_FRAME) < 0) return UNLANG_ACTION_FAIL;
 
        return UNLANG_ACTION_PUSHED_CHILD;
 }
index 95f213b03cdcd6614f38c9281735a7322bec46f8..34a6c47a9bbc8cd7fb917dada9723b4baca9b411 100644 (file)
@@ -162,7 +162,7 @@ static int tmpl_to_values(TALLOC_CTX *ctx, edit_result_t *out, request_t *reques
                return 0;
 
        case TMPL_TYPE_EXEC:
-               if (unlang_tmpl_push(ctx, &out->result, &out->list, request, vpt, NULL) < 0) return -1;
+               if (unlang_tmpl_push(ctx, &out->result, &out->list, request, vpt, NULL, UNLANG_SUB_FRAME) < 0) return -1;
                return 1;
 
        case TMPL_TYPE_XLAT:
index e20ee88e246592d438542f1434371b1eab3a69fc..3de943b9da767b547bd0506221ef015cb76fb8c8 100644 (file)
@@ -115,7 +115,7 @@ static unlang_action_t unlang_limit(unlang_result_t *p_result, request_t *reques
 
        fr_value_box_list_init(&state->result);
 
-       if (unlang_tmpl_push(state, NULL, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL;
+       if (unlang_tmpl_push(state, NULL, &state->result, request, gext->vpt, NULL, UNLANG_SUB_FRAME) < 0) return UNLANG_ACTION_FAIL;
 
        frame_repeat(frame, unlang_limit_xlat_done);
 
index 5b298157a12515b834e38c79886f4aa298e0bfb8..72adf8e442bb0234edd6482141e9cdf52adfa237 100644 (file)
@@ -159,7 +159,7 @@ static unlang_action_t list_mod_create(unlang_result_t *p_result, request_t *req
                        case TMPL_TYPE_EXEC:
                                if (unlang_tmpl_push(update_state, NULL, &update_state->lhs_result,
                                                     request, map->lhs,
-                                                    NULL) < 0) {
+                                                    NULL, UNLANG_SUB_FRAME) < 0) {
                                        return UNLANG_ACTION_STOP_PROCESSING;
                                }
                                return UNLANG_ACTION_PUSHED_CHILD;
@@ -198,7 +198,7 @@ static unlang_action_t list_mod_create(unlang_result_t *p_result, request_t *req
 
                        case TMPL_TYPE_EXEC:
                                if (unlang_tmpl_push(update_state, NULL, &update_state->rhs_result,
-                                                    request, map->rhs, NULL) < 0) {
+                                                    request, map->rhs, NULL, UNLANG_SUB_FRAME) < 0) {
                                        return UNLANG_ACTION_STOP_PROCESSING;
                                }
                                return UNLANG_ACTION_PUSHED_CHILD;
@@ -419,7 +419,7 @@ static unlang_action_t unlang_map_state_init(unlang_result_t *p_result, request_
        }
        case TMPL_TYPE_EXEC:
                if (unlang_tmpl_push(map_proc_state, NULL, &map_proc_state->src_result,
-                                    request, inst->src, NULL) < 0) {
+                                    request, inst->src, NULL, UNLANG_SUB_FRAME) < 0) {
                        return UNLANG_ACTION_STOP_PROCESSING;
                }
                return UNLANG_ACTION_PUSHED_CHILD;
index 2cf5869044a6517c4d05c33e7dc15e69ae32e2dd..46fd9bdbe021505dfd78b25e65c5ac8af433c9a3 100644 (file)
@@ -227,7 +227,7 @@ unlang_action_t unlang_module_yield_to_tmpl(TALLOC_CTX *ctx, fr_value_box_list_t
        /*
         *      Push the xlat function
         */
-       if (unlang_tmpl_push(ctx, NULL, out, request, vpt, args) < 0) return UNLANG_ACTION_FAIL;
+       if (unlang_tmpl_push(ctx, NULL, out, request, vpt, args, UNLANG_SUB_FRAME) < 0) return UNLANG_ACTION_FAIL;
 
        return UNLANG_ACTION_PUSHED_CHILD;
 }
index 2a85cb4636fc9d7932d0e51083c9434aab89012f..e76fa03bdb6c08471d8481f094ca34db72d421f7 100644 (file)
@@ -175,7 +175,7 @@ static unlang_action_t unlang_timeout(unlang_result_t *p_result, request_t *requ
 
        fr_value_box_list_init(&state->result);
 
-       if (unlang_tmpl_push(state, NULL, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL;
+       if (unlang_tmpl_push(state, NULL, &state->result, request, gext->vpt, NULL, UNLANG_SUB_FRAME) < 0) return UNLANG_ACTION_FAIL;
 
        frame_repeat(frame, unlang_timeout_done);
 
index 0a640b710af5010b446ceb9e8fd7259b5592aec9..02a24f8d8e67abd185b399b43e7717c65c9c0a60 100644 (file)
@@ -268,12 +268,13 @@ push:
  * @param[in] tmpl             the tmpl to expand
  * @param[in] args             additional controls for expanding #TMPL_TYPE_EXEC,
  *                             and where the status of exited programs will be stored.
+ * @param[in] top_frame                If true, then this is the top frame of the sub-stack.
  * @return
  *     - 0 on success
  *     - -1 on failure
  */
 int unlang_tmpl_push(TALLOC_CTX *ctx, unlang_result_t *p_result, fr_value_box_list_t *out, request_t *request,
-                    tmpl_t const *tmpl, unlang_tmpl_args_t *args)
+                    tmpl_t const *tmpl, unlang_tmpl_args_t *args, bool top_frame)
 {
        unlang_stack_t                  *stack = request->stack;
        unlang_stack_frame_t            *frame;
@@ -320,7 +321,7 @@ int unlang_tmpl_push(TALLOC_CTX *ctx, unlang_result_t *p_result, fr_value_box_li
         *      Push a new tmpl frame onto the stack
         */
        if (unlang_interpret_push(p_result, request, unlang_tmpl_to_generic(ut),
-                                 FRAME_CONF(RLM_MODULE_NOT_SET, false), UNLANG_NEXT_STOP) < 0) return -1;
+                                 FRAME_CONF(RLM_MODULE_NOT_SET, top_frame), UNLANG_NEXT_STOP) < 0) return -1;
 
        frame = &stack->frame[stack->depth];
        state = talloc_get_type_abort(frame->state, unlang_frame_state_tmpl_t);
index 5ba222c720e32305a14e29fa5093e56b05f647cb..9eaa3e984bf1a08cdf329eb19c88d5f2c75a4a92 100644 (file)
@@ -109,7 +109,7 @@ typedef void (*fr_unlang_tmpl_signal_t)(request_t *request, void *rctx, fr_signa
 typedef unlang_action_t (*fr_unlang_tmpl_resume_t)(unlang_result_t *p_result, request_t *request, void *rctx);
 
 int            unlang_tmpl_push(TALLOC_CTX *ctx, unlang_result_t *p_result, fr_value_box_list_t *out,
-                                request_t *request, tmpl_t const *tmpl, unlang_tmpl_args_t *args)
+                                request_t *request, tmpl_t const *tmpl, unlang_tmpl_args_t *args, bool top_frame)
                CC_HINT(warn_unused_result);
 
 #ifdef __cplusplus
index 1231ad1b1103b2016cb9e2a399a6825facd64e74..5a2d93bff8e5bd70bcc2a5720f3c659756b673f1 100644 (file)
@@ -1455,7 +1455,7 @@ xlat_action_t xlat_frame_eval(TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_exp_head_
 
                                if (unlang_tmpl_push(ctx, NULL, &rctx->list, request, node->vpt,
                                                     TMPL_ARGS_EXEC(NULL, fr_time_delta_from_sec(EXEC_TIMEOUT),
-                                                                   false, &rctx->status)) < 0) goto fail;
+                                                                   false, &rctx->status), UNLANG_SUB_FRAME) < 0) goto fail;
 
                                xa = XLAT_ACTION_PUSH_UNLANG;
                                goto finish;
index a3050a5d690cd00816e5c78029bbdf2e647f19dd..1e10053d503c894c9dbcef5603a6977470c28912 100644 (file)
@@ -728,7 +728,7 @@ unlang_action_t rlm_ldap_cacheable_groupobj(unlang_result_t *p_result, request_t
                RETURN_UNLANG_FAIL;
        }
 
-       if (unlang_tmpl_push(group_ctx, NULL, &group_ctx->expanded_filter, request, autz_ctx->call_env->group_filter, NULL) < 0) goto error;
+       if (unlang_tmpl_push(group_ctx, NULL, &group_ctx->expanded_filter, request, autz_ctx->call_env->group_filter, NULL, UNLANG_SUB_FRAME) < 0) goto error;
 
        return UNLANG_ACTION_PUSHED_CHILD;
 }
@@ -855,7 +855,7 @@ unlang_action_t rlm_ldap_check_groupobj_dynamic(unlang_result_t *p_result, reque
                RETURN_UNLANG_FAIL;
        }
 
-       if (unlang_tmpl_push(group_ctx, NULL, &group_ctx->expanded_filter, request, group_ctx->filter_tmpl, NULL) < 0) goto error;
+       if (unlang_tmpl_push(group_ctx, NULL, &group_ctx->expanded_filter, request, group_ctx->filter_tmpl, NULL, UNLANG_SUB_FRAME) < 0) goto error;
 
        return UNLANG_ACTION_PUSHED_CHILD;
 }
index bbfd2d1a4ef229a185cc3a05b58564659338b1b0..55c849b06054bb21831a99fc7c1fafe83288c606 100644 (file)
@@ -2173,7 +2173,7 @@ next:
        if (usermod_ctx->current_mod < usermod_ctx->num_mods) {
                if (unlang_module_yield(request, user_modify_mod_build_resume, NULL, 0, usermod_ctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
                if (unlang_tmpl_push(usermod_ctx, NULL, &usermod_ctx->expanded, request,
-                                    usermod_ctx->call_env->mod[usermod_ctx->current_mod]->tmpl, NULL) < 0) RETURN_UNLANG_FAIL;
+                                    usermod_ctx->call_env->mod[usermod_ctx->current_mod]->tmpl, NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
                return UNLANG_ACTION_PUSHED_CHILD;
        }
 
@@ -2214,7 +2214,7 @@ static unlang_action_t CC_HINT(nonnull) user_modify_resume(unlang_result_t *p_re
        if (unlang_module_yield(request, user_modify_mod_build_resume, NULL, 0, usermod_ctx) == UNLANG_ACTION_FAIL) goto fail;
 ;
        if (unlang_tmpl_push(usermod_ctx, NULL, &usermod_ctx->expanded, request,
-                            usermod_ctx->call_env->mod[0]->tmpl, NULL) < 0) goto fail;
+                            usermod_ctx->call_env->mod[0]->tmpl, NULL, UNLANG_SUB_FRAME) < 0) goto fail;
 
        return UNLANG_ACTION_PUSHED_CHILD;
 }
index 825c81fb2067ac7c926cfd57fdf25d668d234060..e536ff56c601ac95e38f70bcee38bf82bbf18690 100644 (file)
@@ -2311,7 +2311,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(unlang_result_t *p_resu
 
                        fr_value_box_list_init(&auth_ctx->cpw_ctx->local_cpw_result);
                        if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->local_cpw_result, request,
-                                            env_data->local_cpw, NULL) < 0) RETURN_UNLANG_FAIL;
+                                            env_data->local_cpw, NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
                        break;
 #else
                        REDEBUG("Local MS-CHAPv2 password changes require OpenSSL support");
@@ -2337,7 +2337,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(unlang_result_t *p_resu
                        if (env_data->ntlm_cpw_domain) {
                                fr_value_box_list_init(&auth_ctx->cpw_ctx->cpw_domain);
                                if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->cpw_domain, request,
-                                               env_data->ntlm_cpw_domain, NULL) < 0) RETURN_UNLANG_FAIL;
+                                                    env_data->ntlm_cpw_domain, NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
                        }
 
                        fr_value_box_list_init(&auth_ctx->cpw_ctx->cpw_user);
@@ -2346,7 +2346,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(unlang_result_t *p_resu
                         *      b) Expanding the username
                         */
                        if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->cpw_user, request,
-                                            env_data->ntlm_cpw_username, NULL) < 0) RETURN_UNLANG_FAIL;
+                                            env_data->ntlm_cpw_username, NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
                        break;
                }
 
index 91887bf8db9ff5f04581921021917cb29ce610f5..b16670521bd441436f769f410a41f122485a5d55 100644 (file)
@@ -1221,7 +1221,7 @@ static xlat_action_t sql_group_xlat(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t
        fr_value_box_list_init(&xlat_ctx->query);
 
        if (unlang_xlat_yield(request, sql_group_xlat_resume, NULL, 0, xlat_ctx) != XLAT_ACTION_YIELD) return XLAT_ACTION_FAIL;
-       if (unlang_tmpl_push(xlat_ctx, NULL, &xlat_ctx->query, request, call_env->membership_query, NULL) < 0) return XLAT_ACTION_FAIL;
+       if (unlang_tmpl_push(xlat_ctx, NULL, &xlat_ctx->query, request, call_env->membership_query, NULL, UNLANG_SUB_FRAME) < 0) return XLAT_ACTION_FAIL;
        return XLAT_ACTION_PUSH_UNLANG;
 }
 
@@ -1374,7 +1374,7 @@ static unlang_action_t CC_HINT(nonnull)  mod_autz_group_resume(unlang_result_t *
                if (call_env->group_check_query) {
                        if (unlang_module_yield(request, mod_autz_group_resume, NULL, 0, mctx->rctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
                        if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request,
-                                            call_env->group_check_query, NULL) < 0) RETURN_UNLANG_FAIL;
+                                            call_env->group_check_query, NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }
 
@@ -1429,7 +1429,7 @@ static unlang_action_t CC_HINT(nonnull)  mod_autz_group_resume(unlang_result_t *
                group_reply_push:
                        if (unlang_module_yield(request, mod_autz_group_resume, NULL, 0, mctx->rctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
                        if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request,
-                                            call_env->group_reply_query, NULL) < 0) RETURN_UNLANG_FAIL;
+                                            call_env->group_reply_query, NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
                        autz_ctx->status = autz_ctx->status & SQL_AUTZ_STAGE_GROUP ? SQL_AUTZ_GROUP_REPLY : SQL_AUTZ_PROFILE_REPLY;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }
@@ -1593,7 +1593,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize_resume(unlang_result_t *p_
                if (!call_env->reply_query) goto skip_reply;
 
                if (unlang_module_yield(request, mod_authorize_resume, NULL, 0, autz_ctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
-               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->reply_query, NULL) < 0) RETURN_UNLANG_FAIL;
+               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->reply_query, NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
                autz_ctx->status = SQL_AUTZ_REPLY;
                return UNLANG_ACTION_PUSHED_CHILD;
 
@@ -1657,7 +1657,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize_resume(unlang_result_t *p_
 
                        if (unlang_module_yield(request, mod_autz_group_resume, NULL, 0, autz_ctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
                        if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request,
-                                            call_env->membership_query, NULL) < 0) RETURN_UNLANG_FAIL;
+                                            call_env->membership_query, NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
                        autz_ctx->status = SQL_AUTZ_GROUP_MEMB;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }
@@ -1739,13 +1739,13 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize(unlang_result_t *p_result,
         *      Query the check table to find any conditions associated with this user/realm/whatever...
         */
        if (call_env->check_query) {
-               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->check_query, NULL) < 0) goto error;
+               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->check_query, NULL, UNLANG_SUB_FRAME) < 0) goto error;
                autz_ctx->status = SQL_AUTZ_CHECK;
                return UNLANG_ACTION_PUSHED_CHILD;
        }
 
        if (call_env->reply_query) {
-               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->reply_query, NULL) < 0) goto error;
+               if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->reply_query, NULL, UNLANG_SUB_FRAME) < 0) goto error;
                autz_ctx->status = SQL_AUTZ_REPLY;
                return UNLANG_ACTION_PUSHED_CHILD;
        }
@@ -1753,7 +1753,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize(unlang_result_t *p_result,
        /*
         *      Neither check nor reply queries were set, so we must be doing group stuff
         */
-       if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->membership_query, NULL) < 0) goto error;
+       if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->membership_query, NULL, UNLANG_SUB_FRAME) < 0) goto error;
        autz_ctx->status = SQL_AUTZ_GROUP_MEMB;
        return UNLANG_ACTION_PUSHED_CHILD;
 }
@@ -1850,7 +1850,7 @@ next:
        redundant_ctx->query_no++;
        if (redundant_ctx->query_no >= talloc_array_length(call_env->query)) RETURN_UNLANG_NOOP;
        if (unlang_module_yield(request, mod_sql_redundant_resume, NULL, 0, redundant_ctx) == UNLANG_ACTION_FAIL) RETURN_UNLANG_FAIL;
-       if (unlang_tmpl_push(redundant_ctx, NULL, &redundant_ctx->query, request, call_env->query[redundant_ctx->query_no], NULL) < 0) RETURN_UNLANG_FAIL;
+       if (unlang_tmpl_push(redundant_ctx, NULL, &redundant_ctx->query, request, call_env->query[redundant_ctx->query_no], NULL, UNLANG_SUB_FRAME) < 0) RETURN_UNLANG_FAIL;
 
        RDEBUG2("Trying next query...");
 
index bbbca456aa73dfd3bb2081bb4d52c5aecc7103bd..4f31484ad2047d7266c15275576df3a16735cf7e 100644 (file)
@@ -283,7 +283,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                if (env->existing) {
                        alloc_ctx->status = IPPOOL_ALLOC_EXISTING;
                        REPEAT_MOD_ALLOC_RESUME;
-                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->existing, NULL) < 0) {
+                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->existing, NULL, UNLANG_SUB_FRAME) < 0) {
                        error:
                                talloc_free(alloc_ctx);
                                RETURN_UNLANG_FAIL;
@@ -310,7 +310,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                if (env->requested && (env->requested_address.type != FR_TYPE_NULL)) {
                        alloc_ctx->status = IPPOOL_ALLOC_REQUESTED;
                        REPEAT_MOD_ALLOC_RESUME;
-                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->requested, NULL) < 0) goto error;
+                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->requested, NULL, UNLANG_SUB_FRAME) < 0) goto error;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }
                goto expand_find;
@@ -333,7 +333,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                 */
                alloc_ctx->status = IPPOOL_ALLOC_FIND;
                REPEAT_MOD_ALLOC_RESUME;
-               if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->find, NULL) < 0) goto error;
+               if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->find, NULL, UNLANG_SUB_FRAME) < 0) goto error;
                return UNLANG_ACTION_PUSHED_CHILD;
 
        case IPPOOL_ALLOC_FIND:
@@ -364,7 +364,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                if (env->pool_check) {
                        alloc_ctx->status = IPPOOL_ALLOC_POOL_CHECK;
                        REPEAT_MOD_ALLOC_RESUME;
-                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->pool_check, NULL) < 0) goto error;
+                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->pool_check, NULL, UNLANG_SUB_FRAME) < 0) goto error;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }
        no_address:
@@ -405,7 +405,7 @@ static unlang_action_t mod_alloc_resume(unlang_result_t *p_result, module_ctx_t
                if (env->update) {
                        alloc_ctx->status = IPPOOL_ALLOC_UPDATE;
                        REPEAT_MOD_ALLOC_RESUME;
-                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->update, NULL) < 0) goto error;
+                       if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->update, NULL, UNLANG_SUB_FRAME) < 0) goto error;
                        return UNLANG_ACTION_PUSHED_CHILD;
                }