]> granicus.if.org Git - pdns/commitdiff
removal of dottedEndsOn
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Nov 2015 19:59:58 +0000 (20:59 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Nov 2015 19:59:58 +0000 (20:59 +0100)
pdns/misc.cc
pdns/misc.hh
pdns/syncres.cc

index 0b2f7c8ad0617cbf97e25c8ace102f28b4e676d7..f33584f98021ba950c7b6e560482a0b139c4a5ca 100644 (file)
@@ -223,14 +223,6 @@ bool endsOn(const string &domain, const string &suffix)
   return true;
 }
 
-// REMOVE ME
-bool dottedEndsOn(const DNSName &domain, const DNSName &suffix)
-{
-  return domain.isPartOf(suffix);
-}
-
-
-
 static void parseService4(const string &descr, ServiceTuple &st)
 {
   vector<string>parts;
index 3697af4f6b131135cb9ffff6362d2b6921fd0fb2..9dbad019bdd5683f8247c1e354e1c9417f2f70ea 100644 (file)
@@ -55,7 +55,6 @@ bool chopOff(string &domain);
 bool chopOffDotted(string &domain);
 
 bool endsOn(const string &domain, const string &suffix);
-bool dottedEndsOn(const DNSName &domain, const DNSName &suffix); // REMOVE ME
 string nowTime();
 const string unquotify(const string &item);
 string humanDuration(time_t passed);
index 64c515ede9666d48280dcd70125c3ef0bbaef390..719fe1a3052882f591ab48b8fd39b8ef01e8ea75 100644 (file)
@@ -1180,8 +1180,8 @@ int SyncRes::doResolveAt(set<DNSName> nameservers, DNSName auth, bool flawedNSSe
 
       for(auto& rec : lwr.d_records) {
         if(rec.d_place==DNSResourceRecord::AUTHORITY && rec.d_type==QType::SOA &&
-           lwr.d_rcode==RCode::NXDomain && dottedEndsOn(qname,rec.d_name) && dottedEndsOn(rec.d_name, auth)) {
-          LOG(prefix<<qname.toString()<<": got negative caching indication for name '"<<qname.toString()+"' (accept="<<dottedEndsOn(rec.d_name, auth)<<"), newtarget='"<<newtarget.toString()<<"'"<<endl);
+           lwr.d_rcode==RCode::NXDomain && qname.isPartOf(rec.d_name) && rec.d_name.isPartOf(auth)) {
+          LOG(prefix<<qname.toString()<<": got negative caching indication for name '"<<qname.toString()+"' (accept="<<rec.d_name.isPartOf(auth)<<"), newtarget='"<<newtarget.toString()<<"'"<<endl);
 
           rec.d_ttl = min(rec.d_ttl, s_maxnegttl);
           if(newtarget.empty()) // only add a SOA if we're not going anywhere after this
@@ -1236,11 +1236,11 @@ int SyncRes::doResolveAt(set<DNSName> nameservers, DNSName auth, bool flawedNSSe
          }
           nsset.insert(DNSName(rec.d_content->getZoneRepresentation()));
         }
-        else if(rec.d_place==DNSResourceRecord::AUTHORITY && dottedEndsOn(qname,rec.d_name) && rec.d_type==QType::DS) {
+        else if(rec.d_place==DNSResourceRecord::AUTHORITY && qname.isPartOf(rec.d_name) && rec.d_type==QType::DS) {
          LOG(prefix<<qname.toString()<<": got DS record '"<<rec.d_name.toString()<<"' -> '"<<rec.d_content->getZoneRepresentation()<<"'"<<endl);
          sawDS=true;
        }
-        else if(!done && rec.d_place==DNSResourceRecord::AUTHORITY && dottedEndsOn(qname,rec.d_name) && rec.d_type==QType::SOA &&
+        else if(!done && rec.d_place==DNSResourceRecord::AUTHORITY && qname.isPartOf(rec.d_name) && rec.d_type==QType::SOA &&
            lwr.d_rcode==RCode::NoError) {
           LOG(prefix<<qname.toString()<<": got negative caching indication for '"<< (qname.toString()+"|"+qtype.getName()+"'") <<endl);