From: Willem Toorop Date: Mon, 30 Mar 2020 09:39:07 +0000 (+0200) Subject: Fix uncached CLIENT_RESPONSE'es on stateful transports X-Git-Tag: release-1.11.0~70^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d9eee84025d0ee6c75cf0da46d063187ae8213f;p=thirdparty%2Funbound.git Fix uncached CLIENT_RESPONSE'es on stateful transports Because repinfo->c->buffer does not contain the response when the it did not came from cache. Only after tcp_req_info_send_reply is called, is the response on the buffer which is used to fill the dnstap protobuf's. --- diff --git a/util/netevent.c b/util/netevent.c index 090238384..e90987549 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -3153,18 +3153,18 @@ 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->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 } }