]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set the initial frame action correctly for resumed requests
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 7 May 2025 00:43:18 +0000 (18:43 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 7 May 2025 00:53:01 +0000 (18:53 -0600)
src/lib/unlang/interpret.c

index e75503612307bf6b93174b71c390b39448c4265b..60ee2588469b68bb6fc228edd85b8a3bddba9b09 100644 (file)
@@ -711,7 +711,6 @@ unlang_frame_action_t frame_eval(request_t *request, unlang_stack_frame_t *frame
  */
 CC_HINT(hot) rlm_rcode_t unlang_interpret(request_t *request, bool running)
 {
-       unlang_frame_action_t   fa = UNLANG_FRAME_ACTION_NEXT;
        rlm_rcode_t             rcode;
 
        /*
@@ -721,6 +720,14 @@ CC_HINT(hot) rlm_rcode_t unlang_interpret(request_t *request, bool running)
        unlang_interpret_t      *intp = stack->intp;
        unlang_stack_frame_t    *frame = &stack->frame[stack->depth];   /* Quiet static analysis */
 
+       /*
+        *      This is needed to ensure that if a frame is marked
+        *      for unwinding whilst the request is yielded, we
+        *      unwind the cancelled frame correctly, instead of
+        *      continuing.
+        */
+       unlang_frame_action_t   fa = is_unwinding(frame) ? UNLANG_FRAME_ACTION_POP : UNLANG_FRAME_ACTION_NEXT;
+
        stack->priority = -1;   /* Reset */
 
 #ifndef NDEBUG