From: Willem Toorop Date: Mon, 30 Mar 2020 10:19:17 +0000 (+0200) Subject: Send tcp_req_info->spool_buffer as dnstap CLIENT_RESPONSE X-Git-Tag: release-1.11.0~70^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F208%2Fhead;p=thirdparty%2Funbound.git Send tcp_req_info->spool_buffer as dnstap CLIENT_RESPONSE When tcp_req_info exists. This fixes that dnstap CLIENT_RESPONSE messages did not contain the response message when answering on statful transport for uncached responses. --- diff --git a/util/netevent.c b/util/netevent.c index e90987549..f7bb9b897 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -3153,18 +3153,21 @@ comm_point_send_reply(struct comm_reply *repinfo) &repinfo->addr, repinfo->c->type, repinfo->c->buffer); #endif } else { +#ifdef USE_DNSTAP + if(repinfo->c->tcp_parent->dtenv != NULL && + repinfo->c->tcp_parent->dtenv->log_client_response_messages) + dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv, + &repinfo->addr, repinfo->c->type, + ( repinfo->c->tcp_req_info + ? repinfo->c->tcp_req_info->spool_buffer + : repinfo->c->buffer )); +#endif if(repinfo->c->tcp_req_info) { tcp_req_info_send_reply(repinfo->c->tcp_req_info); } else { comm_point_start_listening(repinfo->c, -1, repinfo->c->tcp_timeout_msec); } -#ifdef USE_DNSTAP - if(repinfo->c->tcp_parent->dtenv != NULL && - repinfo->c->tcp_parent->dtenv->log_client_response_messages) - dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv, - &repinfo->addr, repinfo->c->type, repinfo->c->buffer); -#endif } }