From: Alan T. DeKok Date: Thu, 10 Jul 2025 19:35:06 +0000 (-0400) Subject: add p_result to unlang_tmpl_push() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33a8e8e2d7eca5fca65c4fc39068a2c42b2c3373;p=thirdparty%2Ffreeradius-server.git add p_result to unlang_tmpl_push() --- diff --git a/src/lib/server/trigger.c b/src/lib/server/trigger.c index 7270645e97..e2d56eed5d 100644 --- a/src/lib/server/trigger.c +++ b/src/lib/server/trigger.c @@ -391,7 +391,7 @@ int trigger_exec(unlang_interpret_t *intp, MEM(vpt = tmpl_alloc(trigger, TMPL_TYPE_EXEC, quote, value, talloc_array_length(value))); tmpl_set_xlat(vpt, xlat); - if (unlang_tmpl_push(trigger, &trigger->out, request, vpt, + if (unlang_tmpl_push(trigger, NULL, &trigger->out, request, vpt, &(unlang_tmpl_args_t) { .type = UNLANG_TMPL_ARGS_TYPE_EXEC, .exec = { diff --git a/src/lib/unlang/call_env.c b/src/lib/unlang/call_env.c index a7705a53a1..614a5891fb 100644 --- a/src/lib/unlang/call_env.c +++ b/src/lib/unlang/call_env.c @@ -232,7 +232,8 @@ static unlang_action_t call_env_expand_start(UNUSED unlang_result_t *p_result, r ctx = *out; } - if (unlang_tmpl_push(ctx, &call_env_rctx->tmpl_expanded, request, call_env_rctx->last_expanded->data.tmpl, + 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; return UNLANG_ACTION_PUSHED_CHILD; diff --git a/src/lib/unlang/edit.c b/src/lib/unlang/edit.c index 4abe1e624e..c02e1fedaf 100644 --- a/src/lib/unlang/edit.c +++ b/src/lib/unlang/edit.c @@ -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, request, vpt, NULL) < 0) return -1; + if (unlang_tmpl_push(ctx, &out->success, &out->result, request, vpt, NULL) < 0) return -1; return 1; case TMPL_TYPE_XLAT: diff --git a/src/lib/unlang/limit.c b/src/lib/unlang/limit.c index 1dc6c90031..e20ee88e24 100644 --- a/src/lib/unlang/limit.c +++ b/src/lib/unlang/limit.c @@ -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, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL; + if (unlang_tmpl_push(state, NULL, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL; frame_repeat(frame, unlang_limit_xlat_done); diff --git a/src/lib/unlang/map.c b/src/lib/unlang/map.c index 71c1fd0575..5b298157a1 100644 --- a/src/lib/unlang/map.c +++ b/src/lib/unlang/map.c @@ -157,7 +157,7 @@ static unlang_action_t list_mod_create(unlang_result_t *p_result, request_t *req break; case TMPL_TYPE_EXEC: - if (unlang_tmpl_push(update_state, &update_state->lhs_result, + if (unlang_tmpl_push(update_state, NULL, &update_state->lhs_result, request, map->lhs, NULL) < 0) { return UNLANG_ACTION_STOP_PROCESSING; @@ -197,7 +197,7 @@ static unlang_action_t list_mod_create(unlang_result_t *p_result, request_t *req break; case TMPL_TYPE_EXEC: - if (unlang_tmpl_push(update_state, &update_state->rhs_result, + if (unlang_tmpl_push(update_state, NULL, &update_state->rhs_result, request, map->rhs, NULL) < 0) { return UNLANG_ACTION_STOP_PROCESSING; } @@ -418,7 +418,7 @@ static unlang_action_t unlang_map_state_init(unlang_result_t *p_result, request_ break; } case TMPL_TYPE_EXEC: - if (unlang_tmpl_push(map_proc_state, &map_proc_state->src_result, + if (unlang_tmpl_push(map_proc_state, NULL, &map_proc_state->src_result, request, inst->src, NULL) < 0) { return UNLANG_ACTION_STOP_PROCESSING; } diff --git a/src/lib/unlang/module.c b/src/lib/unlang/module.c index 48f24cb643..25854e53fc 100644 --- a/src/lib/unlang/module.c +++ b/src/lib/unlang/module.c @@ -241,7 +241,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, out, request, vpt, args) < 0) return UNLANG_ACTION_FAIL; + if (unlang_tmpl_push(ctx, NULL, out, request, vpt, args) < 0) return UNLANG_ACTION_FAIL; return UNLANG_ACTION_PUSHED_CHILD; } diff --git a/src/lib/unlang/timeout.c b/src/lib/unlang/timeout.c index bdc07ef528..d7fcdb5074 100644 --- a/src/lib/unlang/timeout.c +++ b/src/lib/unlang/timeout.c @@ -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, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL; + if (unlang_tmpl_push(state, NULL, &state->result, request, gext->vpt, NULL) < 0) return UNLANG_ACTION_FAIL; frame_repeat(frame, unlang_timeout_done); diff --git a/src/lib/unlang/tmpl.c b/src/lib/unlang/tmpl.c index 0325958cd4..c005709578 100644 --- a/src/lib/unlang/tmpl.c +++ b/src/lib/unlang/tmpl.c @@ -28,6 +28,7 @@ RCSID("$Id$") #include #include #include +#include #include "tmpl_priv.h" #include @@ -247,7 +248,7 @@ static unlang_action_t unlang_tmpl(unlang_result_t *p_result, request_t *request */ frame_repeat(frame, unlang_tmpl_exec_wait_resume); push: - if (unlang_xlat_push(state->ctx, &state->xlat_result, &state->list, request, tmpl_xlat(ut->tmpl), false) < 0) { + if (unlang_xlat_push(state->ctx, &state->xlat_result, &state->list, request, tmpl_xlat(ut->tmpl), UNLANG_SUB_FRAME) < 0) { fail: return UNLANG_ACTION_STOP_PROCESSING; } @@ -258,6 +259,7 @@ push: /** Push a tmpl onto the stack for evaluation * * @param[in] ctx To allocate value boxes and values in. + * @param[out] p_result The frame result * @param[out] out The value_box created from the tmpl. May be NULL, * in which case the result is discarded. * @param[in] request The current request. @@ -268,7 +270,7 @@ push: * - 0 on success * - -1 on failure */ -int unlang_tmpl_push(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *request, +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) { unlang_stack_t *stack = request->stack; @@ -277,7 +279,7 @@ int unlang_tmpl_push(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *reque unlang_tmpl_t *ut; - static unlang_t tmpl_instruction = { + static unlang_t const tmpl_instruction_return = { .type = UNLANG_TYPE_TMPL, .name = "tmpl", .debug_name = "tmpl", @@ -297,23 +299,38 @@ int unlang_tmpl_push(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *reque }, }; + static const unlang_t tmpl_instruction_fail = { + .type = UNLANG_TYPE_TMPL, + .name = "tmpl", + .debug_name = "tmpl", + .actions = DEFAULT_MOD_ACTIONS, + }; + if (tmpl_needs_resolving(tmpl)) { REDEBUG("Expansion \"%pV\" needs to be resolved before it is used", fr_box_strvalue_len(tmpl->name, tmpl->len)); return -1; } + /* + * Avoid an extra stack frame and more work. But only if the caller hands us a result. + * Otherwise, we have to return UNLANG_FAIL. + */ + if (p_result && (tmpl_rules_cast(tmpl) == FR_TYPE_NULL) && tmpl_is_xlat(tmpl)) { + return unlang_xlat_push(ctx, p_result, out, request, tmpl_xlat(tmpl), UNLANG_SUB_FRAME); + } + fr_assert(!tmpl_contains_regex(tmpl)); MEM(ut = talloc(stack, unlang_tmpl_t)); *ut = (unlang_tmpl_t){ - .self = tmpl_instruction, + .self = p_result ? tmpl_instruction_fail : tmpl_instruction_return, .tmpl = tmpl }; /* * Push a new tmpl frame onto the stack */ - if (unlang_interpret_push(NULL, request, unlang_tmpl_to_generic(ut), + 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 = &stack->frame[stack->depth]; diff --git a/src/lib/unlang/tmpl.h b/src/lib/unlang/tmpl.h index 05c8de3f00..5ba222c720 100644 --- a/src/lib/unlang/tmpl.h +++ b/src/lib/unlang/tmpl.h @@ -108,7 +108,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, fr_value_box_list_t *out, +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) CC_HINT(warn_unused_result); diff --git a/src/lib/unlang/xlat.c b/src/lib/unlang/xlat.c index 658480d0fc..defa3b2bcf 100644 --- a/src/lib/unlang/xlat.c +++ b/src/lib/unlang/xlat.c @@ -270,6 +270,7 @@ static int unlang_xlat_push_internal(TALLOC_CTX *ctx, unlang_result_t *p_result, /** Push a pre-compiled xlat onto the stack for evaluation * * @param[in] ctx To allocate value boxes and values in. + * @param[out] p_result The frame result * @param[out] out Where to write the result of the expansion. * @param[in] request to push xlat onto. * @param[in] xlat to evaluate. diff --git a/src/lib/unlang/xlat_eval.c b/src/lib/unlang/xlat_eval.c index 126900c325..fa7935403e 100644 --- a/src/lib/unlang/xlat_eval.c +++ b/src/lib/unlang/xlat_eval.c @@ -1453,7 +1453,7 @@ xlat_action_t xlat_frame_eval(TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_exp_head_ if (unlang_xlat_yield(request, xlat_exec_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) goto fail; - if (unlang_tmpl_push(ctx, &rctx->list, request, node->vpt, + 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; diff --git a/src/modules/rlm_ldap/groups.c b/src/modules/rlm_ldap/groups.c index b54d231a8a..a3050a5d69 100644 --- a/src/modules/rlm_ldap/groups.c +++ b/src/modules/rlm_ldap/groups.c @@ -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, &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) < 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, &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) < 0) goto error; return UNLANG_ACTION_PUSHED_CHILD; } diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 238019feee..bbfd2d1a4e 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -2172,7 +2172,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, &usermod_ctx->expanded, request, + 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; return UNLANG_ACTION_PUSHED_CHILD; } @@ -2213,7 +2213,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, &usermod_ctx->expanded, request, + if (unlang_tmpl_push(usermod_ctx, NULL, &usermod_ctx->expanded, request, usermod_ctx->call_env->mod[0]->tmpl, NULL) < 0) goto fail; return UNLANG_ACTION_PUSHED_CHILD; diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c index ac6ae5af39..825c81fb20 100644 --- a/src/modules/rlm_mschap/rlm_mschap.c +++ b/src/modules/rlm_mschap/rlm_mschap.c @@ -2310,7 +2310,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, &auth_ctx->cpw_ctx->local_cpw_result, request, + if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->local_cpw_result, request, env_data->local_cpw, NULL) < 0) RETURN_UNLANG_FAIL; break; #else @@ -2336,7 +2336,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, &auth_ctx->cpw_ctx->cpw_domain, request, + if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->cpw_domain, request, env_data->ntlm_cpw_domain, NULL) < 0) RETURN_UNLANG_FAIL; } @@ -2345,7 +2345,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, &auth_ctx->cpw_ctx->cpw_user, request, + if (unlang_tmpl_push(auth_ctx, NULL, &auth_ctx->cpw_ctx->cpw_user, request, env_data->ntlm_cpw_username, NULL) < 0) RETURN_UNLANG_FAIL; break; } diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 2f22a01fc5..91887bf8db 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -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, &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) < 0) return XLAT_ACTION_FAIL; return XLAT_ACTION_PUSH_UNLANG; } @@ -1373,7 +1373,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, &autz_ctx->query, request, + if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->group_check_query, NULL) < 0) RETURN_UNLANG_FAIL; return UNLANG_ACTION_PUSHED_CHILD; } @@ -1428,7 +1428,7 @@ static unlang_action_t CC_HINT(nonnull) mod_autz_group_resume(unlang_result_t * if (call_env->group_reply_query) { 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, &autz_ctx->query, request, + if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->group_reply_query, NULL) < 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, &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) < 0) RETURN_UNLANG_FAIL; autz_ctx->status = SQL_AUTZ_REPLY; return UNLANG_ACTION_PUSHED_CHILD; @@ -1656,7 +1656,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, &autz_ctx->query, request, + if (unlang_tmpl_push(autz_ctx, NULL, &autz_ctx->query, request, call_env->membership_query, NULL) < 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, &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) < 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, &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) < 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, &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) < 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, &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) < 0) RETURN_UNLANG_FAIL; RDEBUG2("Trying next query..."); diff --git a/src/modules/rlm_sqlippool/rlm_sqlippool.c b/src/modules/rlm_sqlippool/rlm_sqlippool.c index 7fb966304e..bbbca456aa 100644 --- a/src/modules/rlm_sqlippool/rlm_sqlippool.c +++ b/src/modules/rlm_sqlippool/rlm_sqlippool.c @@ -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, &alloc_ctx->values, request, env->existing, NULL) < 0) { + if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->existing, NULL) < 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, &alloc_ctx->values, request, env->requested, NULL) < 0) goto error; + if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->requested, NULL) < 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, &alloc_ctx->values, request, env->find, NULL) < 0) goto error; + if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->find, NULL) < 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, &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) < 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, &alloc_ctx->values, request, env->update, NULL) < 0) goto error; + if (unlang_tmpl_push(alloc_ctx, NULL, &alloc_ctx->values, request, env->update, NULL) < 0) goto error; return UNLANG_ACTION_PUSHED_CHILD; }