]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
when returning YIELD, ALSO set p_result == YIELD
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Dec 2020 18:23:36 +0000 (13:23 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Dec 2020 18:33:16 +0000 (13:33 -0500)
otherwise worker.c has no idea that the function yielded, and
just uses the default return code to do ??? something.

15 files changed:
src/lib/server/rcode.h
src/modules/proto_arp/proto_arp_process.c
src/modules/proto_detail/proto_detail_process.c
src/modules/proto_dhcpv4/proto_dhcpv4_process.c
src/modules/proto_dhcpv6/proto_dhcpv6_process.c
src/modules/proto_radius/proto_radius_acct.c
src/modules/proto_radius/proto_radius_auth.c
src/modules/proto_radius/proto_radius_coa.c
src/modules/proto_radius/proto_radius_dynamic_client.c
src/modules/proto_radius/proto_radius_status.c
src/modules/proto_tacacs/proto_tacacs_acct.c
src/modules/proto_tacacs/proto_tacacs_auth.c
src/modules/proto_tacacs/proto_tacacs_autz.c
src/modules/proto_vmps/proto_vmps_dynamic_client.c
src/modules/proto_vmps/proto_vmps_process.c

index f1da47d26462ef302f357c88d7bd36f4774041eb..2b01e2c832287ce9e0584335ace4b42571d2026c 100644 (file)
@@ -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[];
index cb56747e1a6e21339ee8b09f1e41eed32113ef22..d7d89cc4a4fc7703a81d4958859dfac6b25dc3f0 100644 (file)
@@ -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:
index e77abc5dd0b1a24768292c3161dc541fce44424a..fc667c22435c18c72ed7a1f7251922b9179ba8e4 100644 (file)
@@ -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:
index 6c6e6050ec1191ae70aaf78d40d879b1962c17ac..becbd893b5b11d22131b79649361b9dd9b2e7310 100644 (file)
@@ -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:
index edb39cbc6935ec5345274fe5ba16d6f44b98f27a..61463fab74b40d225b567ce3f0f29838c78e0296 100644 (file)
@@ -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:
index 4808ebadbdcc133d34dbb8bcbfda291dd12aad5e..226f04d9dbc796d43581ebd34efab3e1ce01e5dc 100644 (file)
@@ -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:
index c35ecb2c89b80d3f74966ebdda4f81c08b0feb14..e6a84b8db4d0bfaccc1c6abbdf4cce6b314458ce 100644 (file)
@@ -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:
index e50dc12370e8824c75a4a6ee2612c2caec883742..c7f6066e9bbe57240063c3a954ff5fac43c456e1 100644 (file)
@@ -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) {
                        /*
index 87d72d751fd21c1facb2f90003dc73900c7bd31d..a16a0faa7229fd6c3db9473cfff6436611365d94 100644 (file)
@@ -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:
index 36721adf773dc40911c801f6d40d83099a21973c..1995909a6d1e49e65b3823ad596173d4faa42d03 100644 (file)
@@ -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:
index 12c948b1613f35c605ffcbeee1646c8cdeae8d36..b1c40289b24e4293bb065900255a48fe934a9cc1 100644 (file)
@@ -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:
index 83cd7565f9ccfe90bf259d0adf3e85fb8ee1bdb0..b42d3e2f78058c275b749f8794e09e98c19ce82c 100644 (file)
@@ -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:
index a68101f9bf3e5661b5343143344c56cef4c5d986..8f91f6574902ce78c3c279004297b080b52e9656 100644 (file)
@@ -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:
index 269116cbd665a17f1ed009c58ab0e3ba908fc9ad..c6d65c534d32ab8c03d358d2e786a06b356a31a7 100644 (file)
@@ -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:
index 8bf66de42ce2e4804d06107f21ff943252bc4e47..403d8e5f535cf257aa85fd4dd024a246d6f200e4 100644 (file)
@@ -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: