Changeset 2117

Show
Ignore:
Timestamp:
04/02/11 11:57:55 (2 years ago)
Author:
ahu
Message:

silence a lot of debugging

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/packethandler.cc

    r2114 r2117  
    454454void PacketHandler::emitNSEC(const std::string& begin, const std::string& end, const std::string& toNSEC, const SOAData& sd, DNSPacket *r, int mode) 
    455455{ 
    456   cerr<<"We should emit '"<<begin<<"' - ('"<<toNSEC<<"') - '"<<end<<"'"<<endl; 
     456  // <<"We should emit '"<<begin<<"' - ('"<<toNSEC<<"') - '"<<end<<"'"<<endl; 
    457457  NSECRecordContent nrc; 
    458458  nrc.d_set.insert(QType::RRSIG); 
     
    482482void 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) 
    483483{ 
    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; 
    485485  NSEC3RecordContent n3rc; 
    486486  n3rc.d_set.insert(QType::RRSIG); 
     
    528528{ 
    529529  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()<<": "; 
    531531  bool narrow; 
    532532  if(d_dk.getNSEC3PARAM(auth, &ns3rc, &narrow))  { 
    533     cerr<<"Present, narrow="<<narrow<<endl; 
     533    // cerr<<"Present, narrow="<<narrow<<endl; 
    534534    addNSEC3(p, r, target, auth, ns3rc, narrow, mode); 
    535535  } 
    536536  else { 
    537     cerr<<"Not present"<<endl; 
     537    // cerr<<"Not present"<<endl; 
    538538    addNSEC(p, r, target, auth, mode); 
    539539  } 
     
    598598  sd.db = (DNSBackend*)-1; 
    599599  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"; 
    601601    return; 
    602602  } 
     
    609609   
    610610  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); 
    612612  emitNSEC3(ns3rc, sd, unhashed, before, after, target, r, mode); 
    613613 
     
    616616  hashed=hashQNameWithSalt(ns3rc.d_iterations, ns3rc.d_salt, unhashed); 
    617617  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); 
    619619  emitNSEC3( ns3rc, sd, unhashed, before, after, target, r, mode); 
    620620   
     
    624624   
    625625  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); 
    627627  emitNSEC3( ns3rc, sd, unhashed, before, after, target, r, mode); 
    628628} 
     
    633633    return; 
    634634   
    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); 
    636636  SOAData sd; 
    637637  sd.db=(DNSBackend *)-1; // force uncached answer 
     
    641641  } 
    642642  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); 
    644644    return; 
    645645  } 
    646646 
    647647  string before,after; 
    648   cerr<<"Calling getBeforeandAfter!"<<endl; 
     648  //cerr<<"Calling getBeforeandAfter!"<<endl; 
    649649  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; 
    651651 
    652652  // this stuff is wrong (but it appears to work) 
     
    677677    return false; 
    678678   
    679   cerr<<"Have arrs "<<arrs.size()<<" records to sign\n"; 
     679  DLOG(L<<"Have arrs "<<arrs.size()<<" records to sign"<<endl); 
    680680  vector<DNSResourceRecord> crrs; 
    681681   
     
    757757 
    758758    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); 
    760760    } 
    761761 
     
    903903void PacketHandler::synthesiseRRSIGs(DNSPacket* p, DNSPacket* r) 
    904904{ 
    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); 
    906906  typedef map<uint16_t, vector<shared_ptr<DNSRecordContent> > > records_t; 
    907907  records_t records; 
     
    943943  bool doNSEC3= d_dk.getNSEC3PARAM(sd.qname, &ns3pr, &narrow); 
    944944  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); 
    946946  } 
    947947  else { 
     
    960960    // ok, the NSEC is in.. 
    961961  } 
    962   cerr<<"Have "<<records.size()<<" rrsets to sign"<<endl; 
     962  DLOG(L<<"Have "<<records.size()<<" rrsets to sign"<<endl); 
    963963 
    964964  rr.qname = p->qdomain; 
     
    10381038    return false; 
    10391039   
    1040   cerr<<"The best NS is: "<<rrset.begin()->qname<<endl; 
     1040  DLOG(L<<"The best NS is: "<<rrset.begin()->qname<<endl); 
    10411041  BOOST_FOREACH(DNSResourceRecord rr, rrset) { 
    1042     cerr<<"\tadding '"<<rr.content<<"'\n"; 
     1042    DLOG(L<<"\tadding '"<<rr.content<<"'"<<endl); 
    10431043    rr.d_place=DNSResourceRecord::AUTHORITY; 
    10441044    r->addRecord(rr); 
     
    10551055{ 
    10561056  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; 
    10581058  //  cerr<<"Need to add all the NSEC too.."<<endl; /// XXX FIXME THE ABOVE IF IS WEIRD 
    10591059   
     
    10851085 
    10861086  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); 
    10881088    nodata=true; 
    10891089  } 
    10901090  else { 
    1091     cerr<<"The best wildcard match: "<<rrset.begin()->qname<<endl; 
     1091    DLOG(L<<"The best wildcard match: "<<rrset.begin()->qname<<endl); 
    10921092    BOOST_FOREACH(DNSResourceRecord rr, rrset) { 
    10931093      if(rr.qtype.getCode() == QType::CNAME)  { 
     
    10981098      rr.wildcardname = rr.qname; 
    10991099      rr.qname=p->qdomain; 
    1100       cerr<<"\tadding '"<<rr.content<<"'\n"; 
     1100      DLOG(L<<"\tadding '"<<rr.content<<"'"<<endl); 
    11011101      rr.d_place=DNSResourceRecord::ANSWER; 
    11021102      r->addRecord(rr); 
     
    12981298        goto sendit; 
    12991299      } 
    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); 
    13011301      if(!tryReferral(p, r, sd, target)) 
    13021302        makeNXDomain(p, r, target, sd); 
     
    13291329    } 
    13301330    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); 
    13321333      if(tryReferral(p, r, sd, target)) 
    13331334        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; 
    13351336    } 
    13361337    else { 
    1337       cerr<<"Have some data, but not the right data"<<endl; 
     1338      DLOG(L<<"Have some data, but not the right data"<<endl); 
    13381339      makeNOError(p, r, target, sd); 
    13391340    }