]> granicus.if.org Git - pdns/commitdiff
DNSName: fix dnsreplay.cc
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 10 Jul 2015 09:46:35 +0000 (11:46 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 15 Jul 2015 14:49:14 +0000 (16:49 +0200)
pdns/dnsreplay.cc

index 582de7d494f7f1bde14ef8ed1d2967a3d32ea53a..47979ce98689e445820cd2a0884da59224f22d74 100644 (file)
@@ -268,7 +268,7 @@ bool isRcodeOk(int rcode)
   return rcode==0 || rcode==3;
 }
 
-set<pair<string,uint16_t> > s_origbetterset;
+set<pair<DNSName,uint16_t> > s_origbetterset;
 
 bool isRootReferral(const MOADNSParser::answers_t& answers)
 {
@@ -280,7 +280,7 @@ bool isRootReferral(const MOADNSParser::answers_t& answers)
     //    cerr<<(int)iter->first.d_place<<", "<<iter->first.d_label<<" "<<iter->first.d_type<<", # "<<answers.size()<<endl;
     if(iter->first.d_place!=2)
       ok=false;
-    if(iter->first.d_label!="." || iter->first.d_type!=QType::NS)
+    if(!iter->first.d_label.isRoot() || iter->first.d_type!=QType::NS)
       ok=false;
   }
   return ok;
@@ -372,17 +372,17 @@ void measureResultAndClean(qids_t::const_iterator iter)
       s_origbetter++;
       if(!g_quiet) 
         if(s_origbetterset.insert(make_pair(qd.d_qi.d_qname, qd.d_qi.d_qtype)).second) {
-          cout<<"orig better: " << qd.d_qi.d_qname<<" "<< qd.d_qi.d_qtype<<endl;
+          cout<<"orig better: " << qd.d_qi.d_qname.toString()<<" "<< qd.d_qi.d_qtype<<endl;
         }
     }
 
     if(!g_quiet) {
       cout<<"orig: rcode="<<qd.d_origRcode<<"\n";
       for(set<DNSRecord>::const_iterator i=canonicOrig.begin(); i!=canonicOrig.end(); ++i)
-        cout<<"\t"<<i->d_label<<"\t"<<DNSRecordContent::NumberToType(i->d_type)<<"\t'"  << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n";
+        cout<<"\t"<<i->d_label.toString()<<"\t"<<DNSRecordContent::NumberToType(i->d_type)<<"\t'"  << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n";
       cout<<"new: rcode="<<qd.d_newRcode<<"\n";
       for(set<DNSRecord>::const_iterator i=canonicNew.begin(); i!=canonicNew.end(); ++i)
-        cout<<"\t"<<i->d_label<<"\t"<<DNSRecordContent::NumberToType(i->d_type)<<"\t'"  << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n";
+        cout<<"\t"<<i->d_label.toString()<<"\t"<<DNSRecordContent::NumberToType(i->d_type)<<"\t'"  << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n";
       cout<<"\n";
       cout<<"-\n";
 
@@ -421,7 +421,7 @@ try
       qids_by_id_index_t::const_iterator found=idindex.find(ntohs(mdp.d_header.id));
       if(found == idindex.end()) {
         if(!g_quiet)      
-          cout<<"Received an answer ("<<mdp.d_qname<<") from reference nameserver with id "<<mdp.d_header.id<<" which we can't match to a question!"<<endl;
+          cout<<"Received an answer ("<<mdp.d_qname.toString()<<") from reference nameserver with id "<<mdp.d_header.id<<" which we can't match to a question!"<<endl;
         s_weunmatched++;
         continue;
       }