From: Alan T. DeKok Date: Thu, 1 May 2025 11:03:48 +0000 (-0400) Subject: retry limits return timeout, not fail X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=045c26e1067599e7e9f2c4e59055681774bcbb02;p=thirdparty%2Ffreeradius-server.git retry limits return timeout, not fail --- diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 53a854c368..595060f2f5 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -378,8 +378,7 @@ unlang_frame_action_t result_calculate(request_t *request, unlang_stack_frame_t * then allocate the structure and set the timer. */ if (!retry) { - frame->retry = retry = talloc_zero(stack, unlang_retry_t); - if (!frame->retry) goto fail; + MEM(frame->retry = retry = talloc_zero(stack, unlang_retry_t)); retry->request = request; retry->depth = stack->depth; @@ -398,8 +397,9 @@ unlang_frame_action_t result_calculate(request_t *request, unlang_stack_frame_t if (fr_timer_at(retry, unlang_interpret_event_list(request)->tl, &retry->ev, retry->timeout, false, instruction_retry_handler, request) < 0) { - RPEDEBUG("Failed inserting event"); - goto fail; + RPEDEBUG("Failed inserting retry event"); + *result = RLM_MODULE_FAIL; + goto finalize; } } @@ -408,7 +408,7 @@ unlang_frame_action_t result_calculate(request_t *request, unlang_stack_frame_t * We've been told to stop doing retries, * probably from a timeout. */ - if (retry->state != FR_RETRY_CONTINUE) goto fail; + if (retry->state != FR_RETRY_CONTINUE) goto timeout; /* * Clamp it at the maximum count. @@ -419,10 +419,10 @@ unlang_frame_action_t result_calculate(request_t *request, unlang_stack_frame_t if (retry->count >= instruction->actions.retry.mrc) { retry->state = FR_RETRY_MRC; - REDEBUG("Retries hit max_rtx_count (%u) - returning 'fail'", instruction->actions.retry.mrc); + REDEBUG("Retries hit max_rtx_count (%u) - returning 'timeout'", instruction->actions.retry.mrc); - fail: - *result = RLM_MODULE_FAIL; + timeout: + *result = RLM_MODULE_TIMEOUT; goto finalize; } }