Changeset 2117
- Timestamp:
- 04/02/11 11:57:55 (2 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/packethandler.cc (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/packethandler.cc
r2114 r2117 454 454 void PacketHandler::emitNSEC(const std::string& begin, const std::string& end, const std::string& toNSEC, const SOAData& sd, DNSPacket *r, int mode) 455 455 { 456 cerr<<"We should emit '"<<begin<<"' - ('"<<toNSEC<<"') - '"<<end<<"'"<<endl;456 // <<"We should emit '"<<begin<<"' - ('"<<toNSEC<<"') - '"<<end<<"'"<<endl; 457 457 NSECRecordContent nrc; 458 458 nrc.d_set.insert(QType::RRSIG); … … 482 482 void emitNSEC3(DNSBackend& B, const NSEC3PARAMRecordContent& ns3prc, const SOAData& sd, const std::string& unhashed, const std::string& begin, const std::string& end, const std::string& toNSEC3, DNSPacket *r, int mode) 483 483 { 484 cerr<<"We should emit NSEC3 '"<<toLower(toBase32Hex(begin))<<"' - ('"<<toNSEC3<<"') - '"<<toLower(toBase32Hex(end))<<"' (unhashed: '"<<unhashed<<"')"<<endl;484 // cerr<<"We should emit NSEC3 '"<<toLower(toBase32Hex(begin))<<"' - ('"<<toNSEC3<<"') - '"<<toLower(toBase32Hex(end))<<"' (unhashed: '"<<unhashed<<"')"<<endl; 485 485 NSEC3RecordContent n3rc; 486 486 n3rc.d_set.insert(QType::RRSIG); … … 528 528 { 529 529 NSEC3PARAMRecordContent ns3rc; 530 cerr<<"Doing NSEC3PARAM lookup for '"<<auth<<"', "<<p->qdomain<<"|"<<p->qtype.getName()<<": ";530 // cerr<<"Doing NSEC3PARAM lookup for '"<<auth<<"', "<<p->qdomain<<"|"<<p->qtype.getName()<<": "; 531 531 bool narrow; 532 532 if(d_dk.getNSEC3PARAM(auth, &ns3rc, &narrow)) { 533 cerr<<"Present, narrow="<<narrow<<endl;533 // cerr<<"Present, narrow="<<narrow<<endl; 534 534 addNSEC3(p, r, target, auth, ns3rc, narrow, mode); 535 535 } 536 536 else { 537 cerr<<"Not present"<<endl;537 // cerr<<"Not present"<<endl; 538 538 addNSEC(p, r, target, auth, mode); 539 539 } … … 598 598 sd.db = (DNSBackend*)-1; 599 599 if(!B.getSOA(auth, sd)) { 600 cerr<<"Could not get SOA for domain in NSEC3\n";600 // cerr<<"Could not get SOA for domain in NSEC3\n"; 601 601 return; 602 602 } … … 609 609 610 610 getNSEC3Hashes(narrow, sd.db, sd.domain_id, hashed, false, unhashed, before, after); 611 cerr<<"Done calling for closest encloser, before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"', unhashed: '"<<unhashed<<"'"<<endl;611 DLOG(L<<"Done calling for closest encloser, before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"', unhashed: '"<<unhashed<<"'"<<endl); 612 612 emitNSEC3(ns3rc, sd, unhashed, before, after, target, r, mode); 613 613 … … 616 616 hashed=hashQNameWithSalt(ns3rc.d_iterations, ns3rc.d_salt, unhashed); 617 617 getNSEC3Hashes(narrow, sd.db,sd.domain_id, hashed, true, unhashed, before, after); 618 cerr<<"Done calling for main, before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"', unhashed: '"<<unhashed<<"'"<<endl;618 DLOG(L<<"Done calling for main, before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"', unhashed: '"<<unhashed<<"'"<<endl); 619 619 emitNSEC3( ns3rc, sd, unhashed, before, after, target, r, mode); 620 620 … … 624 624 625 625 getNSEC3Hashes(narrow, sd.db, sd.domain_id, hashed, true, unhashed, before, after); 626 cerr<<"Done calling for '*', before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"', unhashed: '"<<unhashed<<"'"<<endl;626 DLOG(L<<"Done calling for '*', before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"', unhashed: '"<<unhashed<<"'"<<endl); 627 627 emitNSEC3( ns3rc, sd, unhashed, before, after, target, r, mode); 628 628 } … … 633 633 return; 634 634 635 cerr<<"Should add NSEC covering '"<<target<<"' from zone '"<<auth<<"', mode = "<<mode<<endl;635 DLOG(L<<"Should add NSEC covering '"<<target<<"' from zone '"<<auth<<"', mode = "<<mode<<endl); 636 636 SOAData sd; 637 637 sd.db=(DNSBackend *)-1; // force uncached answer … … 641 641 } 642 642 else if(!B.getSOA(auth, sd)) { 643 cerr<<"Could not get SOA for domain\n";643 DLOG(L<<"Could not get SOA for domain"<<endl); 644 644 return; 645 645 } 646 646 647 647 string before,after; 648 cerr<<"Calling getBeforeandAfter!"<<endl;648 //cerr<<"Calling getBeforeandAfter!"<<endl; 649 649 sd.db->getBeforeAndAfterNames(sd.domain_id, auth, target, before, after); 650 cerr<<"Done calling, before='"<<before<<"', after='"<<after<<"'"<<endl;650 // cerr<<"Done calling, before='"<<before<<"', after='"<<after<<"'"<<endl; 651 651 652 652 // this stuff is wrong (but it appears to work) … … 677 677 return false; 678 678 679 cerr<<"Have arrs "<<arrs.size()<<" records to sign\n";679 DLOG(L<<"Have arrs "<<arrs.size()<<" records to sign"<<endl); 680 680 vector<DNSResourceRecord> crrs; 681 681 … … 757 757 758 758 if(crossedZoneCut) { 759 cerr<<"Should return NS records, and this A/AAAA record in the additional section.."<<endl;759 DLOG(L<<"Should return NS records, and this A/AAAA record in the additional section.."<<endl); 760 760 } 761 761 … … 903 903 void PacketHandler::synthesiseRRSIGs(DNSPacket* p, DNSPacket* r) 904 904 { 905 cerr<<"Need to fake up the RRSIGs if someone asked for them explicitly"<<endl;905 DLOG(L<<"Need to fake up the RRSIGs if someone asked for them explicitly"<<endl); 906 906 typedef map<uint16_t, vector<shared_ptr<DNSRecordContent> > > records_t; 907 907 records_t records; … … 943 943 bool doNSEC3= d_dk.getNSEC3PARAM(sd.qname, &ns3pr, &narrow); 944 944 if(doNSEC3) { 945 cerr<<"We don't yet add NSEC3 to explicit RRSIG queries correctly yet! (narrow="<<narrow<<")\n";945 DLOG(L<<"We don't yet add NSEC3 to explicit RRSIG queries correctly yet! (narrow="<<narrow<<")"<<endl); 946 946 } 947 947 else { … … 960 960 // ok, the NSEC is in.. 961 961 } 962 cerr<<"Have "<<records.size()<<" rrsets to sign"<<endl;962 DLOG(L<<"Have "<<records.size()<<" rrsets to sign"<<endl); 963 963 964 964 rr.qname = p->qdomain; … … 1038 1038 return false; 1039 1039 1040 cerr<<"The best NS is: "<<rrset.begin()->qname<<endl;1040 DLOG(L<<"The best NS is: "<<rrset.begin()->qname<<endl); 1041 1041 BOOST_FOREACH(DNSResourceRecord rr, rrset) { 1042 cerr<<"\tadding '"<<rr.content<<"'\n";1042 DLOG(L<<"\tadding '"<<rr.content<<"'"<<endl); 1043 1043 rr.d_place=DNSResourceRecord::AUTHORITY; 1044 1044 r->addRecord(rr); … … 1055 1055 { 1056 1056 if(!p->d_dnssecOk) 1057 cerr<<"Need to add all the RRSIGs too for '"<<target<<"', should do this manually since DNSSEC was not requested"<<endl;1057 ; // cerr<<"Need to add all the RRSIGs too for '"<<target<<"', should do this manually since DNSSEC was not requested"<<endl; 1058 1058 // cerr<<"Need to add all the NSEC too.."<<endl; /// XXX FIXME THE ABOVE IF IS WEIRD 1059 1059 … … 1085 1085 1086 1086 if(rrset.empty()) { 1087 cerr<<"Wildcard matched something, but not of the correct type"<<endl;1087 DLOG(L<<"Wildcard matched something, but not of the correct type"<<endl); 1088 1088 nodata=true; 1089 1089 } 1090 1090 else { 1091 cerr<<"The best wildcard match: "<<rrset.begin()->qname<<endl;1091 DLOG(L<<"The best wildcard match: "<<rrset.begin()->qname<<endl); 1092 1092 BOOST_FOREACH(DNSResourceRecord rr, rrset) { 1093 1093 if(rr.qtype.getCode() == QType::CNAME) { … … 1098 1098 rr.wildcardname = rr.qname; 1099 1099 rr.qname=p->qdomain; 1100 cerr<<"\tadding '"<<rr.content<<"'\n";1100 DLOG(L<<"\tadding '"<<rr.content<<"'"<<endl); 1101 1101 rr.d_place=DNSResourceRecord::ANSWER; 1102 1102 r->addRecord(rr); … … 1298 1298 goto sendit; 1299 1299 } 1300 cerr<<"Found nothing in the ANY and wildcards, let's try NS referral"<<endl;1300 DLOG(L<<"Found nothing in the ANY and wildcards, let's try NS referral"<<endl); 1301 1301 if(!tryReferral(p, r, sd, target)) 1302 1302 makeNXDomain(p, r, target, sd); … … 1329 1329 } 1330 1330 else if(weHaveUnauth) { 1331 cerr<<"Have unauth data, so need to hunt for best NS records"<<endl; 1331 1332 DLOG(L<<"Have unauth data, so need to hunt for best NS records"<<endl); 1332 1333 if(tryReferral(p, r, sd, target)) 1333 1334 goto sendit; 1334 cerr<<"Should not get here: please run pdnssec rectify-zone "<<sd.qname<<endl;1335 L<<Logger::Error<<"Should not get here: please run pdnssec rectify-zone "<<sd.qname<<endl; 1335 1336 } 1336 1337 else { 1337 cerr<<"Have some data, but not the right data"<<endl;1338 DLOG(L<<"Have some data, but not the right data"<<endl); 1338 1339 makeNOError(p, r, target, sd); 1339 1340 }