From: bert hubert Date: Thu, 23 Feb 2017 15:25:40 +0000 (+0100) Subject: FindNS lookup should actually look at an UeberBackend. This solves mind04's concerns... X-Git-Tag: rec-4.1.0-alpha1~253^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4549%2Fhead;p=thirdparty%2Fpdns.git FindNS lookup should actually look at an UeberBackend. This solves mind04's concerns. It also makes the code compile again. --- diff --git a/pdns/communicator.hh b/pdns/communicator.hh index 3346b7d019..b5e2c0f4f9 100644 --- a/pdns/communicator.hh +++ b/pdns/communicator.hh @@ -243,7 +243,7 @@ private: class FindNS { public: - vector lookup(const DNSName &name, DNSBackend *b) + vector lookup(const DNSName &name, UeberBackend *b) { vector addresses; @@ -251,10 +251,10 @@ public: if(b) { b->lookup(QType(QType::ANY),name); - DNSResourceRecord rr; + DNSZoneRecord rr; while(b->get(rr)) - if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA) - addresses.push_back(rr.content); // SOL if you have a CNAME for an NS + if(rr.dr.d_type == QType::A || rr.dr.d_type==QType::AAAA) + addresses.push_back(rr.dr.d_content->getZoneRepresentation()); // SOL if you have a CNAME for an NS } return addresses; } diff --git a/pdns/mastercommunicator.cc b/pdns/mastercommunicator.cc index d50928000a..310b11bec6 100644 --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@ -46,25 +46,25 @@ void CommunicatorClass::queueNotifyDomain(const DomainInfo& di, UeberBackend* B) { bool hasQueuedItem=false; set nsset, ips; - DNSResourceRecord rr; + DNSZoneRecord rr; FindNS fns; if (d_onlyNotify.size()) { - B->lookup(QType(QType::NS),domain); + B->lookup(QType(QType::NS), di.zone); while(B->get(rr)) - nsset.insert(rr.content); + nsset.insert(getRR(rr.dr)->getNS().toString()); for(set::const_iterator j=nsset.begin();j!=nsset.end();++j) { vector nsips=fns.lookup(DNSName(*j), B); if(nsips.empty()) - L<::const_iterator k=nsips.begin();k!=nsips.end();++k) { const ComboAddress caIp(*k, 53); if(!d_preventSelfNotification || !AddressIsUs(caIp)) { if(!d_onlyNotify.match(&caIp)) - L<::const_iterator j=ips.begin();j!=ips.end();++j) { - L< q) while(B->get(rr)) nsset.insert(DNSName(rr.content)); for(const auto & j: nsset) { - vector nsips=fns.lookup(j, B); + vector nsips=fns.lookup(j, s_P->getBackend()); for(vector::const_iterator k=nsips.begin();k!=nsips.end();++k) { // cerr<<"got "<<*k<<" from AUTO-NS"<getRemote().toString())