]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fix up do-not-respond policies
authorAlan T. DeKok <aland@freeradius.org>
Thu, 29 Jun 2017 13:21:55 +0000 (09:21 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 29 Jun 2017 13:43:10 +0000 (09:43 -0400)
src/modules/proto_radius/proto_radius_auth.c
src/modules/proto_radius/proto_radius_coa.c
src/modules/proto_radius/proto_radius_status.c

index eccecc593b3e0d05ac4e2f549499dfbb0e52ce9d..41725cec633458dab77b54f9b88043cf22008b8a 100644 (file)
@@ -461,24 +461,10 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
                        if (!request->parent) fr_state_discard(global_state, request, request->packet);
                }
 
-               if (!request->reply->code) {
-                       vp = fr_pair_find_by_num(request->control, 0, FR_AUTH_TYPE, TAG_ANY);
-                       if (vp) {
-                               if (vp->vp_uint32 == FR_AUTH_TYPE_ACCEPT) {
-                                       request->reply->code = FR_CODE_ACCESS_ACCEPT;
-
-                               } else if (vp->vp_uint32 == FR_AUTH_TYPE_REJECT) {
-                                       request->reply->code = FR_CODE_ACCESS_REJECT;
-                               }
-                       }
-               }
-
                /*
                 *      Check for "do not respond".
-                *
-                *      @todo - create fake reply
                 */
-               if (!request->reply->code) {
+               if (request->reply->code == FR_CODE_DO_NOT_RESPOND) {
                        RDEBUG("Not sending reply to client.");
                        return FR_IO_REPLY;
                }
@@ -487,7 +473,7 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
                 *      This is an internally generated request.
                 *      Don't print IP addresses.
                 */
-               if (request->packet->data_len == 0) {
+               if (request->parent) {
                        radlog_request(L_DBG, L_DBG_LVL_1, request, "Sent %s ID %i",
                                       fr_packet_codes[request->reply->code], request->reply->id);
                        rdebug_proto_pair_list(L_DBG_LVL_1, request, request->reply->vps, "");
index f7baff365f25e513ba9671f1a4ade8f707f4bcf7..8fdf66ceebb70099ef86efbdc696304492b7eebe 100644 (file)
@@ -189,7 +189,7 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
                /*
                 *      Check for "do not respond".
                 */
-               if (!request->reply->code) {
+               if (request->reply->code == FR_CODE_DO_NOT_RESPOND) {
                        RDEBUG("Not sending reply to client.");
                        return FR_IO_DONE;
                }
@@ -197,7 +197,7 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
                /*
                 *      This is an internally generated request.  Don't print IP addresses.
                 */
-               if (request->packet->data_len == 0) {
+               if (request->parent) {
                        radlog_request(L_DBG, L_DBG_LVL_1, request, "Sent %s ID %i",
                                       fr_packet_codes[request->reply->code], request->reply->id);
                        rdebug_proto_pair_list(L_DBG_LVL_1, request, request->reply->vps, "");
index 0db4436f46c1068df4fd644e1e9e2456ccadea95..9c026937d8d2dce8c7abc653c48a3a4ec6eb36f6 100644 (file)
@@ -154,7 +154,7 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
                /*
                 *      Check for "do not respond".
                 */
-               if (!request->reply->code || (request->reply->code == FR_CODE_DO_NOT_RESPOND)) {
+               if (request->reply->code == FR_CODE_DO_NOT_RESPOND) {
                        RDEBUG("Not sending reply to client.");
                        return FR_IO_DONE;
                }