Changeset 662
- Timestamp:
- 04/05/06 17:37:32 (7 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 2 modified
-
pdns_recursor.cc (modified) (1 diff)
-
syncres.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/pdns_recursor.cc
r656 r662 222 222 nsrr.ttl=time(0)+3600000; 223 223 224 for(char c=' A';c<='M';++c) {224 for(char c='a';c<='m';++c) { 225 225 static char templ[40]; 226 strncpy(templ," A.ROOT-SERVERS.NET", sizeof(templ) - 1);226 strncpy(templ,"a.root-servers.net", sizeof(templ) - 1); 227 227 *templ=c; 228 228 arr.qname=nsrr.content=templ; 229 arr.content=ips[c-' A'];229 arr.content=ips[c-'a']; 230 230 set<DNSResourceRecord> aset; 231 231 aset.insert(arr); -
trunk/pdns/pdns/syncres.cc
r658 r662 470 470 // reap all answers from this packet that are acceptable 471 471 for(LWRes::res_t::const_iterator i=result.begin();i!=result.end();++i) { 472 if(i->qtype.getCode() < 1024) { 473 LOG<<prefix<<qname<<": accept answer '"<<i->qname<<"|"<<i->qtype.getName()<<"|"<<i->content<<"' from '"<<auth<<"' nameservers? "; 474 } 475 else { 476 LOG<<prefix<<qname<<": accept opaque answer '"<<i->qname<<"|"<<QType(i->qtype.getCode()-1024).getName()<<" from '"<<auth<<"' nameservers? "; 477 } 472 LOG<<prefix<<qname<<": accept answer '"<<i->qname<<"|"<<i->qtype.getName()<<"|"<<i->content<<"' from '"<<auth<<"' nameservers? "; 478 473 479 474 if(endsOn(i->qname, auth)) { … … 489 484 rr.d_place=DNSResourceRecord::ANSWER; 490 485 rr.ttl+=d_now.tv_sec; 491 // rr.ttl=time(0)+10+10*rr.qtype.getCode(); 486 if(rr.qtype.getCode() == QType::NS) // people fiddle with the case 487 rr.content=toLower(rr.content); 492 488 tcache[make_pair(toLower(i->qname),i->qtype)].insert(rr); 493 489 } … … 499 495 // supplant 500 496 for(tcache_t::const_iterator i=tcache.begin();i!=tcache.end();++i) { 501 RC.replace(i->first.first, i->first.second,i->second);497 RC.replace(i->first.first, i->first.second, i->second); 502 498 } 503 499 set<string> nsset; … … 528 524 // for ANY answers we *must* have an authoritive answer 529 525 else if(i->d_place==DNSResourceRecord::ANSWER && !strcasecmp(i->qname.c_str(),qname.c_str()) && 530 (((i->qtype==qtype) || (i->qtype.getCode()>1024 && i->qtype.getCode()-1024==qtype.getCode())) 531 || ( qtype==QType(QType::ANY) && d_lwr.d_aabit))) { 532 if(i->qtype.getCode() < 1024) { 533 LOG<<prefix<<qname<<": answer is in: resolved to '"<< i->content<<"|"<<i->qtype.getName()<<"'"<<endl; 534 } 535 else { 536 LOG<<prefix<<qname<<": answer is in: resolved to opaque record of type '"<<QType(i->qtype.getCode()-1024).getName()<<"'"<<endl; 537 } 526 ( (i->qtype==qtype) || 527 ( qtype==QType(QType::ANY) && d_lwr.d_aabit))) { 528 529 LOG<<prefix<<qname<<": answer is in: resolved to '"<< i->content<<"|"<<i->qtype.getName()<<"'"<<endl; 530 538 531 539 532 done=true;