From: Alan T. DeKok Date: Tue, 4 Aug 2026 19:49:54 +0000 (-0400) Subject: don't print module name when inside of call{} X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb2fb5a5a2d818131f296cc0579c5cabcd26233d;p=thirdparty%2Ffreeradius-server.git don't print module name when inside of call{} the debug output is confusing when it prints messages about the virtual server, but the initial and final messages are prefixed with the module name. --- diff --git a/src/lib/unlang/call.c b/src/lib/unlang/call.c index 1e01a7d96a..956e32ff8e 100644 --- a/src/lib/unlang/call.c +++ b/src/lib/unlang/call.c @@ -36,6 +36,7 @@ static unlang_action_t unlang_call_resume(UNUSED unlang_result_t *p_result, requ unlang_group_t *g = unlang_generic_to_group(frame->instruction); unlang_call_t *gext = unlang_group_to_call(g); fr_pair_t *packet_type_vp = NULL; + unlang_frame_state_call_t *state = frame->state; switch (pair_update_reply(&packet_type_vp, gext->attr_packet_type)) { case 0: @@ -46,9 +47,12 @@ static unlang_action_t unlang_call_resume(UNUSED unlang_result_t *p_result, requ break; /* Don't change */ default: + request->module = state->module; RETURN_UNLANG_FAIL; } + request->module = state->module; + return UNLANG_ACTION_CALCULATE_RESULT; } @@ -156,6 +160,8 @@ unlang_action_t unlang_call_push(unlang_result_t *p_result, request_t *request, char const *name; fr_dict_t const *dict; fr_dict_attr_t const *attr_packet_type; + unlang_stack_frame_t *frame; + unlang_frame_state_call_t *state; /* * Temporary hack until packet->code is removed @@ -206,6 +212,11 @@ unlang_action_t unlang_call_push(unlang_result_t *p_result, request_t *request, return UNLANG_ACTION_FAIL; } + frame = &stack->frame[stack->depth]; + state = frame->state; + state->module = request->module; + request->module = NULL; + return UNLANG_ACTION_PUSHED_CHILD; } @@ -340,5 +351,8 @@ void unlang_call_init(void) .unlang_size = sizeof(unlang_call_t), .unlang_name = "unlang_call_t", + + .frame_state_size = sizeof(unlang_frame_state_call_t), + .frame_state_type = "unlang_frame_state_call_t", }); } diff --git a/src/lib/unlang/call_priv.h b/src/lib/unlang/call_priv.h index 2b88c95ae3..f97341f15e 100644 --- a/src/lib/unlang/call_priv.h +++ b/src/lib/unlang/call_priv.h @@ -42,6 +42,15 @@ typedef struct { ///< sections run in the server_cs. } unlang_call_t; +/** A module stack entry + * + * Represents a single module call on the unlang stack. + */ +typedef struct { + char const *module; //!< module name from request->module +} unlang_frame_state_call_t; + + /** Cast a group structure to the call keyword extension * */