From: Chris Hofstaedtler Date: Fri, 27 Sep 2024 06:21:32 +0000 (+0200) Subject: auth: optimize !d_doResolveAcrossZones case X-Git-Tag: rec-5.2.0-beta1~14^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8852fc25eb6045bb00e5aaf5b46b92a69bf32665;p=thirdparty%2Fpdns.git auth: optimize !d_doResolveAcrossZones case --- diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index f2a570a274..32f176c84d 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -1517,6 +1517,12 @@ std::unique_ptr PacketHandler::doQuestion(DNSPacket& p) return r; } + if (retargetcount > 0 && !d_doResolveAcrossZones && !target.isPartOf(r->qdomainzone)) { + // We are following a retarget outside the initial zone (and do not need to check getAuth to know this). Config asked us not to do that. + // This is a performance optimization, the generic case is checked after getAuth below. + goto sendit; // NOLINT(cppcoreguidelines-avoid-goto) + } + if(!B.getAuth(target, p.qtype, &d_sd)) { DLOG(g_log<