From 0076736fc40298eb6252705e6e158462c6b24d06 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 16 Oct 2024 11:52:49 +0200 Subject: [PATCH] - Fix for dnstap with dnscrypt and dnstap without dnsoverquic. --- doc/Changelog | 3 +++ util/netevent.c | 13 ++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 0e5564926..fde05db51 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,9 @@ - Fix for dnsoverquic and dnstap to use the correct dnstap environment. +16 October 2024: Wouter + - Fix for dnstap with dnscrypt and dnstap without dnsoverquic. + 14 October 2024: Wouter - Fix to display warning if quic-port is set but dnsoverquic is not enabled when compiled. diff --git a/util/netevent.c b/util/netevent.c index db190b2c2..b36f00f1a 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -6676,12 +6676,19 @@ comm_point_send_reply(struct comm_reply *repinfo) #endif } else { #ifdef USE_DNSTAP - struct dt_env* dtenv = repinfo->c->doq_socket - ?repinfo->c->dtenv - :repinfo->c->tcp_parent->dtenv; + struct dt_env* dtenv = +#ifdef HAVE_NGTCP2 + repinfo->c->doq_socket + ?repinfo->c->dtenv: +#endif + repinfo->c->tcp_parent->dtenv; struct sldns_buffer* dtbuffer = repinfo->c->tcp_req_info ?repinfo->c->tcp_req_info->spool_buffer :repinfo->c->buffer; +#ifdef USE_DNSCRYPT + if(repinfo->c->dnscrypt && repinfo->is_dnscrypted) + dtbuffer = repinfo->c->buffer; +#endif /* * sending src (client)/dst (local service) addresses over * DNSTAP from other callbacks