]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge branch 'master' into dnsrr
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 23 Feb 2017 12:30:37 +0000 (13:30 +0100)
committerGitHub <noreply@github.com>
Thu, 23 Feb 2017 12:30:37 +0000 (13:30 +0100)
14 files changed:
1  2 
modules/geoipbackend/geoipbackend.cc
pdns/backends/gsql/gsqlbackend.cc
pdns/communicator.hh
pdns/dnsparser.cc
pdns/mastercommunicator.cc
pdns/misc.hh
pdns/pdnsutil.cc
pdns/qtype.hh
pdns/rfc2136handler.cc
pdns/slavecommunicator.cc
pdns/tcpreceiver.cc
pdns/ueberbackend.cc
pdns/ueberbackend.hh
pdns/zoneparser-tng.cc

Simple merge
Simple merge
Simple merge
index ef6e13e3b2db59d3d3239f3f3b29b9844a17f96f,16d1b8aae973cf0eb76b08d44a7cb153e2e179b4..8f6baa7cbed2d0e715d8dacd3800c95bdd4996e7
@@@ -210,19 -211,7 +210,19 @@@ DNSRecord::DNSRecord(const DNSResourceR
    d_content = std::shared_ptr<DNSRecordContent>(DNSRecordContent::mastermake(d_type, rr.qclass, rr.content));
  }
  
- void MOADNSParser::init(const char *packet, unsigned int len)
 +// If you call this and you are not parsing a packet coming from a socket, you are doing it wrong.
 +DNSResourceRecord DNSResourceRecord::fromWire(const DNSRecord& d) {
 +  DNSResourceRecord rr;
 +  rr.qname = d.d_name;
 +  rr.qtype = QType(d.d_type);
 +  rr.ttl = d.d_ttl;
 +  rr.content = d.d_content->getZoneRepresentation(true);
 +  rr.auth = false;
 +  rr.qclass = d.d_class;
 +  return rr;
 +}
 +
+ void MOADNSParser::init(bool query, const char *packet, unsigned int len)
  {
    if(len < sizeof(dnsheader))
      throw MOADNSException("Packet shorter than minimal header");
index 930304149d9f324dcf4f31f36a9a061b7abeae3d,f4c343c123de5ea12293641e2f4f74197945a487..d50928000a89e8b8891c32971146ccd11fe7f455
@@@ -49,30 -49,32 +49,33 @@@ void CommunicatorClass::queueNotifyDoma
    DNSResourceRecord rr;
    FindNS fns;
  
-   di.backend->lookup(QType(QType::NS), di.zone);
-   while(di.backend->get(rr))
-     nsset.insert(rr.content);
-   for(set<string>::const_iterator j=nsset.begin();j!=nsset.end();++j) {
-     vector<string> nsips=fns.lookup(DNSName(*j), di.backend);
-     if(nsips.empty())
-       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 '"<<di.zone<<"' to "<<*j<<" because it does not match only-notify."<<endl;
-           else
-             ips.insert(caIp.toStringWithPort());
++
+   if (d_onlyNotify.size()) {
+     B->lookup(QType(QType::NS),domain);
+     while(B->get(rr))
+       nsset.insert(rr.content);
+     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;
+       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;
+             else
+               ips.insert(caIp.toStringWithPort());
+           }
          }
-       }
-   }
+     }
  
-   for(set<string>::const_iterator j=ips.begin();j!=ips.end();++j) {
-     L<<Logger::Warning<<"Queued notification of domain '"<<di.zone<<"' to "<<*j<<endl;
-     d_nq.add(di.zone,*j);
-     hasQueuedItem=true;
+     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);
+       hasQueuedItem=true;
+     }
    }
  
    set<string> alsoNotify(d_alsoNotify);
diff --cc pdns/misc.hh
Simple merge
Simple merge
diff --cc pdns/qtype.hh
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge