From: Alan T. DeKok Date: Mon, 14 Dec 2020 18:23:36 +0000 (-0500) Subject: when returning YIELD, ALSO set p_result == YIELD X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ddcdc331ecbce717e7a774f9b2259485847321b7;p=thirdparty%2Ffreeradius-server.git when returning YIELD, ALSO set p_result == YIELD otherwise worker.c has no idea that the function yielded, and just uses the default return code to do ??? something. --- diff --git a/src/lib/server/rcode.h b/src/lib/server/rcode.h index f1da47d2646..2b01e2c8322 100644 --- a/src/lib/server/rcode.h +++ b/src/lib/server/rcode.h @@ -62,6 +62,7 @@ typedef enum { #define RETURN_MODULE_NOTFOUND do { *p_result = RLM_MODULE_NOTFOUND; return UNLANG_ACTION_CALCULATE_RESULT; } while (0) #define RETURN_MODULE_NOOP do { *p_result = RLM_MODULE_NOOP; return UNLANG_ACTION_CALCULATE_RESULT; } while (0) #define RETURN_MODULE_UPDATED do { *p_result = RLM_MODULE_UPDATED; return UNLANG_ACTION_CALCULATE_RESULT; } while (0) +#define RETURN_MODULE_YIELD do { *p_result = RLM_MODULE_YIELD; return UNLANG_ACTION_YIELD; } while (0) #define RETURN_MODULE_RCODE(_rcode) do { *p_result = (_rcode); return UNLANG_ACTION_CALCULATE_RESULT; } while (0) extern fr_table_num_sorted_t const rcode_table[]; diff --git a/src/modules/proto_arp/proto_arp_process.c b/src/modules/proto_arp/proto_arp_process.c index cb56747e1a6..d7d89cc4a4f 100644 --- a/src/modules/proto_arp/proto_arp_process.c +++ b/src/modules/proto_arp/proto_arp_process.c @@ -110,7 +110,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; /* * Allow the admin to explicitly set the reply @@ -167,7 +167,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: diff --git a/src/modules/proto_detail/proto_detail_process.c b/src/modules/proto_detail/proto_detail_process.c index e77abc5dd0b..fc667c22435 100644 --- a/src/modules/proto_detail/proto_detail_process.c +++ b/src/modules/proto_detail/proto_detail_process.c @@ -87,7 +87,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { /* @@ -162,7 +162,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4_process.c b/src/modules/proto_dhcpv4/proto_dhcpv4_process.c index 6c6e6050ec1..becbd893b5b 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4_process.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4_process.c @@ -184,7 +184,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; /* * Allow the admin to explicitly set the reply @@ -252,7 +252,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: diff --git a/src/modules/proto_dhcpv6/proto_dhcpv6_process.c b/src/modules/proto_dhcpv6/proto_dhcpv6_process.c index edb39cbc693..61463fab74b 100644 --- a/src/modules/proto_dhcpv6/proto_dhcpv6_process.c +++ b/src/modules/proto_dhcpv6/proto_dhcpv6_process.c @@ -216,7 +216,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; /* * Allow the admin to explicitly set the reply @@ -273,7 +273,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: diff --git a/src/modules/proto_radius/proto_radius_acct.c b/src/modules/proto_radius/proto_radius_acct.c index 4808ebadbdc..226f04d9dbc 100644 --- a/src/modules/proto_radius/proto_radius_acct.c +++ b/src/modules/proto_radius/proto_radius_acct.c @@ -90,7 +90,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { /* @@ -150,7 +150,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { /* @@ -207,7 +207,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: diff --git a/src/modules/proto_radius/proto_radius_auth.c b/src/modules/proto_radius/proto_radius_auth.c index c35ecb2c89b..e6a84b8db4d 100644 --- a/src/modules/proto_radius/proto_radius_auth.c +++ b/src/modules/proto_radius/proto_radius_auth.c @@ -320,7 +320,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: @@ -443,7 +443,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc RETURN_MODULE_HANDLED; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { /* @@ -580,7 +580,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_FAIL: diff --git a/src/modules/proto_radius/proto_radius_coa.c b/src/modules/proto_radius/proto_radius_coa.c index e50dc12370e..c7f6066e9bb 100644 --- a/src/modules/proto_radius/proto_radius_coa.c +++ b/src/modules/proto_radius/proto_radius_coa.c @@ -112,7 +112,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: @@ -170,7 +170,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { /* diff --git a/src/modules/proto_radius/proto_radius_dynamic_client.c b/src/modules/proto_radius/proto_radius_dynamic_client.c index 87d72d751fd..a16a0faa722 100644 --- a/src/modules/proto_radius/proto_radius_dynamic_client.c +++ b/src/modules/proto_radius/proto_radius_dynamic_client.c @@ -92,7 +92,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_OK: case RLM_MODULE_UPDATED: @@ -130,7 +130,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: diff --git a/src/modules/proto_radius/proto_radius_status.c b/src/modules/proto_radius/proto_radius_status.c index 36721adf773..1995909a6d1 100644 --- a/src/modules/proto_radius/proto_radius_status.c +++ b/src/modules/proto_radius/proto_radius_status.c @@ -86,7 +86,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_OK: @@ -134,7 +134,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: diff --git a/src/modules/proto_tacacs/proto_tacacs_acct.c b/src/modules/proto_tacacs/proto_tacacs_acct.c index 12c948b1613..b1c40289b24 100644 --- a/src/modules/proto_tacacs/proto_tacacs_acct.c +++ b/src/modules/proto_tacacs/proto_tacacs_acct.c @@ -176,7 +176,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: @@ -228,7 +228,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { /* @@ -270,7 +270,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_FAIL: diff --git a/src/modules/proto_tacacs/proto_tacacs_auth.c b/src/modules/proto_tacacs/proto_tacacs_auth.c index 83cd7565f9c..b42d3e2f780 100644 --- a/src/modules/proto_tacacs/proto_tacacs_auth.c +++ b/src/modules/proto_tacacs/proto_tacacs_auth.c @@ -219,7 +219,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: @@ -316,7 +316,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { /* @@ -360,7 +360,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_FAIL: diff --git a/src/modules/proto_tacacs/proto_tacacs_autz.c b/src/modules/proto_tacacs/proto_tacacs_autz.c index a68101f9bf3..8f91f657490 100644 --- a/src/modules/proto_tacacs/proto_tacacs_autz.c +++ b/src/modules/proto_tacacs/proto_tacacs_autz.c @@ -132,7 +132,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: @@ -169,7 +169,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_FAIL: diff --git a/src/modules/proto_vmps/proto_vmps_dynamic_client.c b/src/modules/proto_vmps/proto_vmps_dynamic_client.c index 269116cbd66..c6d65c534d3 100644 --- a/src/modules/proto_vmps/proto_vmps_dynamic_client.c +++ b/src/modules/proto_vmps/proto_vmps_dynamic_client.c @@ -94,7 +94,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_OK: @@ -133,7 +133,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: diff --git a/src/modules/proto_vmps/proto_vmps_process.c b/src/modules/proto_vmps/proto_vmps_process.c index 8bf66de42ce..403d8e5f535 100644 --- a/src/modules/proto_vmps/proto_vmps_process.c +++ b/src/modules/proto_vmps/proto_vmps_process.c @@ -92,7 +92,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: @@ -140,7 +140,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co return UNLANG_ACTION_STOP_PROCESSING; } - if (rcode == RLM_MODULE_YIELD) return UNLANG_ACTION_YIELD; + if (rcode == RLM_MODULE_YIELD) RETURN_MODULE_YIELD; switch (rcode) { case RLM_MODULE_NOOP: