From: Arran Cudbard-Bell Date: Mon, 7 Jun 2021 00:39:22 +0000 (-0500) Subject: Have unlang_call_push return an unlang_action_t X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64cc00584ce0fa45fa94787ae04eb383eebe46e0;p=thirdparty%2Ffreeradius-server.git Have unlang_call_push return an unlang_action_t --- diff --git a/src/lib/unlang/call.c b/src/lib/unlang/call.c index 4a59ed4ee9f..f480ffab07f 100644 --- a/src/lib/unlang/call.c +++ b/src/lib/unlang/call.c @@ -88,7 +88,7 @@ static unlang_action_t unlang_call_frame_init(rlm_rcode_t *p_result, request_t * * * This should be used instead of virtual_server_push in the majority of the code */ -int unlang_call_push(request_t *request, CONF_SECTION *server_cs, bool top_frame) +unlang_action_t unlang_call_push(request_t *request, CONF_SECTION *server_cs, bool top_frame) { unlang_stack_t *stack = request->stack; unlang_call_t *c; @@ -101,14 +101,14 @@ int unlang_call_push(request_t *request, CONF_SECTION *server_cs, bool top_frame */ dict = virtual_server_dict(server_cs); if (!dict) { - REDEBUG("No dictionary associated with virtual server"); - return -1; + REDEBUG("Virtual server \"%s\" not compiled", cf_section_name2(server_cs)); + return UNLANG_ACTION_FAIL; } attr_packet_type = fr_dict_attr_by_name(NULL, fr_dict_root(dict), "Packet-Type"); if (!attr_packet_type) { REDEBUG("No Packet-Type attribute available"); - return -1; + return UNLANG_ACTION_FAIL; } /* @@ -147,10 +147,10 @@ int unlang_call_push(request_t *request, CONF_SECTION *server_cs, bool top_frame if (unlang_interpret_push(request, unlang_call_to_generic(c), RLM_MODULE_NOT_SET, UNLANG_NEXT_STOP, top_frame) < 0) { talloc_free(c); - return -1; + return UNLANG_ACTION_FAIL; } - return 0; + return UNLANG_ACTION_PUSHED_CHILD; } /** Return the last virtual server that was called diff --git a/src/lib/unlang/call.h b/src/lib/unlang/call.h index f83b6542fe8..2dd697b8d2d 100644 --- a/src/lib/unlang/call.h +++ b/src/lib/unlang/call.h @@ -29,7 +29,7 @@ extern "C" { #include #include -int unlang_call_push(request_t *request, CONF_SECTION *server_cs, bool top_frame); +unlang_action_t unlang_call_push(request_t *request, CONF_SECTION *server_cs, bool top_frame) CC_HINT(nonnull); CONF_SECTION *unlang_call_current(request_t *request);