From 81e0801bf1b6a95e92d442e85ec419343f2e5dcd Mon Sep 17 00:00:00 2001 From: Otto Date: Tue, 18 May 2021 15:40:44 +0200 Subject: [PATCH] For the NOD lookup case, we don't want QName Minimization. --- pdns/pdns_recursor.cc | 2 +- pdns/syncres.cc | 9 ++++++++- pdns/syncres.hh | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index f0d79cb682..3b974d0bd3 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1335,7 +1335,7 @@ static void sendNODLookup(const DNSName& dname) return; } vector dummy; - directResolve(qname, QType::A, QClass::IN, dummy); + directResolve(qname, QType::A, QClass::IN, dummy, false); } } diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 103bfa73af..dc00e152c5 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -4350,13 +4350,20 @@ void SyncRes::parseEDNSSubnetAddFor(const std::string& subnetlist) } } -// used by PowerDNSLua - note that this neglects to add the packet count & statistics back to pdns_ercursor.cc +// used by PowerDNSLua - note that this neglects to add the packet count & statistics back to pdns_recursor.cc int directResolve(const DNSName& qname, const QType qtype, const QClass qclass, vector& ret) +{ + return directResolve(qname, qtype, qclass, ret, SyncRes::s_qnameminimization); +} + +int directResolve(const DNSName& qname, const QType qtype, const QClass qclass, vector& ret, bool qm) { struct timeval now; gettimeofday(&now, 0); SyncRes sr(now); + sr.setQNameMinimization(qm); + int res = -1; try { res = sr.beginResolve(qname, qtype, qclass, ret, 0); diff --git a/pdns/syncres.hh b/pdns/syncres.hh index a3bf850953..4f931fadd0 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -1115,6 +1115,7 @@ void broadcastFunction(const pipefunc_t& func); void distributeAsyncFunction(const std::string& question, const pipefunc_t& func); int directResolve(const DNSName& qname, const QType qtype, const QClass qclass, vector& ret); +int directResolve(const DNSName& qname, const QType qtype, const QClass qclass, vector& ret, bool qm); int followCNAMERecords(std::vector& ret, const QType qtype, int oldret); int getFakeAAAARecords(const DNSName& qname, ComboAddress prefix, vector& ret); int getFakePTRRecords(const DNSName& qname, vector& ret); -- 2.47.2