]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
failed is code 0, not DO-NOT-Respond
authorAlan T. DeKok <aland@freeradius.org>
Wed, 8 Nov 2017 17:02:50 +0000 (12:02 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 8 Nov 2017 17:07:26 +0000 (12:07 -0500)
src/modules/proto_detail/proto_detail.c
src/modules/proto_detail/proto_detail_process.c
src/modules/proto_detail/proto_detail_work.c

index 3aa3590afd366429664709e9ed262f5e90797eae..1c5e454e7ec0cf6fe4bd0db017b1548a673b6e91 100644 (file)
@@ -338,18 +338,7 @@ static ssize_t mod_encode(UNUSED void const *instance, REQUEST *request, uint8_t
 {
        if (buffer_len < 1) return -1;
 
-       /*
-        *      "Do not respond"
-        */
-       if (request->reply->code == FR_CODE_DO_NOT_RESPOND) {
-               *buffer = 0;
-               return 1;
-       }
-
-       /*
-        *      Do respond.
-        */
-       *buffer = 1;
+       *buffer = request->reply->code;
        return 1;
 }
 
index b0bbb437c897b79b68c220d57b6d12223f3385a6..6b0dd35d0601db8bb071a3e6f05a85b715d90e8a 100644 (file)
@@ -134,7 +134,7 @@ static fr_io_final_t mod_process(REQUEST *request, fr_io_action_t action)
                        if (!unlang) goto send_reply;
 
                } else if (request->reply->code == 257) {
-                       request->reply->code = FR_CODE_DO_NOT_RESPOND;
+                       request->reply->code = 0;
                        unlang = cf_section_find(request->server_cs, "send", "failure");
                        if (!unlang) goto send_reply;
 
@@ -183,7 +183,13 @@ static fr_io_final_t mod_process(REQUEST *request, fr_io_action_t action)
                /*
                 *      This is an internally generated request.  Don't print IP addresses.
                 */
-               if (request->parent) {
+               if (!request->reply->code) {
+                       radlog_request(L_DBG, L_DBG_LVL_1, request, "Failed ID %i",
+                                      request->reply->id);
+                       rdebug_proto_pair_list(L_DBG_LVL_1, request, request->reply->vps, "");
+                       return FR_IO_DONE;
+
+               } else if (request->parent) {
                        radlog_request(L_DBG, L_DBG_LVL_1, request, "Sent %s ID %i",
                                       fr_dict_enum_alias_by_value(NULL, da, fr_box_uint32(request->reply->code)),
                                       request->reply->id);
index 15149cd86a9874b39fe2b72199a2a5ed2c0b8d75..a67184e3f79489782d9e6ebe559c4e27759ed2a9 100644 (file)
@@ -385,11 +385,8 @@ static ssize_t mod_write(void *instance, void *packet_ctx,
 
        inst->outstanding--;
 
-       if (buffer[0] == 0) {
+       if (!buffer[0]) {
                /*
-                *      Note that this packet will be sent again if
-                *      the detail file reader re-starts.  Otherwise,
-                *      it will be dropped without a retry.
                 *
                 *      @todo - put the original packet onto a list
                 *      for retransmissions, and don't finish with the
@@ -397,7 +394,7 @@ static ssize_t mod_write(void *instance, void *packet_ctx,
                 *      retransmitted.  And don't read new ones until
                 *      the old ones are finished.
                 */
-               DEBUG("Got Do-Not-Respond, not writing reply");
+               DEBUG("Packet failed not writing reply");
 
        } else if (inst->track_progress && (track->done_offset > 0)) {
                /*