]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
FindNS lookup should actually look at an UeberBackend. This solves mind04's concerns... 4549/head 5082/head
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 23 Feb 2017 15:25:40 +0000 (16:25 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 23 Feb 2017 15:25:40 +0000 (16:25 +0100)
pdns/communicator.hh
pdns/mastercommunicator.cc
pdns/tcpreceiver.cc

index 3346b7d01922a5ef526871df84ea8520f90f30a4..b5e2c0f4f985f22dd99af7b96a489b84be235039 100644 (file)
@@ -243,7 +243,7 @@ private:
 class FindNS
 {
 public:
-  vector<string> lookup(const DNSName &name, DNSBackend *b)
+  vector<string> lookup(const DNSName &name, UeberBackend *b)
   {
     vector<string> 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;
   }
index d50928000a89e8b8891c32971146ccd11fe7f455..310b11bec661af684cc2f719d4a0670ca1ce3464 100644 (file)
@@ -46,25 +46,25 @@ void CommunicatorClass::queueNotifyDomain(const DomainInfo& di, UeberBackend* B)
 {
   bool hasQueuedItem=false;
   set<string> 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<NSRecordContent>(rr.dr)->getNS().toString());
 
     for(set<string>::const_iterator j=nsset.begin();j!=nsset.end();++j) {
       vector<string> nsips=fns.lookup(DNSName(*j), B);
       if(nsips.empty())
-        L<<Logger::Warning<<"Unable to queue notification of domain '"<<domain<<"': nameservers do not resolve!"<<endl;
+        L<<Logger::Warning<<"Unable to queue notification of domain '"<<di.zone<<"': nameservers do not resolve!"<<endl;
       else
         for(vector<string>::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<<Logger::Info<<"Skipped notification of domain '"<<domain<<"' to "<<*j<<" because it does not match only-notify."<<endl;
+              L<<Logger::Info<<"Skipped notification of domain '"<<di.zone<<"' to "<<*j<<" because it does not match only-notify."<<endl;
             else
               ips.insert(caIp.toStringWithPort());
           }
@@ -72,8 +72,8 @@ void CommunicatorClass::queueNotifyDomain(const DomainInfo& di, UeberBackend* B)
     }
 
     for(set<string>::const_iterator j=ips.begin();j!=ips.end();++j) {
-      L<<Logger::Warning<<"Queued notification of domain '"<<domain<<"' to "<<*j<<endl;
-      d_nq.add(domain,*j);
+      L<<Logger::Warning<<"Queued notification of domain '"<<di.zone<<"' to "<<*j<<endl;
+      d_nq.add(di.zone,*j);
       hasQueuedItem=true;
     }
   }
index af2c493d588d1ecf51ed88049d3eb95e3285bdaf..0d661478b0dbdcb99ace7dbbc392830ea6021fa8 100644 (file)
@@ -543,7 +543,7 @@ bool TCPNameserver::canDoAXFR(shared_ptr<DNSPacket> q)
         while(B->get(rr)) 
           nsset.insert(DNSName(rr.content));
         for(const auto & j: nsset) {
-          vector<string> nsips=fns.lookup(j, B);
+          vector<string> nsips=fns.lookup(j, s_P->getBackend());
           for(vector<string>::const_iterator k=nsips.begin();k!=nsips.end();++k) {
             // cerr<<"got "<<*k<<" from AUTO-NS"<<endl;
             if(*k == q->getRemote().toString())