From: Alan T. DeKok Date: Wed, 8 Nov 2017 17:02:50 +0000 (-0500) Subject: failed is code 0, not DO-NOT-Respond X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f320cb29e83b96ab424b104c96fce13fa6cc68d;p=thirdparty%2Ffreeradius-server.git failed is code 0, not DO-NOT-Respond --- diff --git a/src/modules/proto_detail/proto_detail.c b/src/modules/proto_detail/proto_detail.c index 3aa3590afd3..1c5e454e7ec 100644 --- a/src/modules/proto_detail/proto_detail.c +++ b/src/modules/proto_detail/proto_detail.c @@ -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; } diff --git a/src/modules/proto_detail/proto_detail_process.c b/src/modules/proto_detail/proto_detail_process.c index b0bbb437c89..6b0dd35d060 100644 --- a/src/modules/proto_detail/proto_detail_process.c +++ b/src/modules/proto_detail/proto_detail_process.c @@ -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); diff --git a/src/modules/proto_detail/proto_detail_work.c b/src/modules/proto_detail/proto_detail_work.c index 15149cd86a9..a67184e3f79 100644 --- a/src/modules/proto_detail/proto_detail_work.c +++ b/src/modules/proto_detail/proto_detail_work.c @@ -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)) { /*