]> granicus.if.org Git - pdns/commitdiff
remove a slab of dead code
authorBert Hubert <bert.hubert@netherlabs.nl>
Sat, 25 Feb 2012 18:07:39 +0000 (18:07 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sat, 25 Feb 2012 18:07:39 +0000 (18:07 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2418 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/packethandler.cc

index 9f80e7cae9aca924bbde17bd7aecf1f0a0188def..5faff78781442a38e422bef0f31cbe9e2f9311dd 100644 (file)
@@ -715,90 +715,6 @@ bool PacketHandler::doDNSSECProcessing(DNSPacket *p, DNSPacket *r)
   
   return false;
 }
-#if 0
-/* returns 1 if everything is done & ready, 0 if the search should continue, 2 if a 'NO-ERROR' response should be generated */
-int PacketHandler::makeCanonic(DNSPacket *p, DNSPacket *r, string &target)
-{
-  DNSResourceRecord rr;
-
-  bool found=false, rfound=false;
-
-  if(p->qtype.getCode()!=QType::CNAME && !d_doCNAME)
-    return 0;
-
-  // Traverse a CNAME chain if needed
-  for(int numloops=0;;numloops++) {
-    if(numloops==10) {
-      L<<Logger::Error<<"Detected a CNAME loop involving "<<target<<", sending SERVFAIL"<<endl;
-      r->setRcode(2);
-      return 1;
-    }
-
-    B.lookup(QType(QType::ANY),target,p);
-        
-    bool shortcut=p->qtype.getCode()!=QType::SOA && p->qtype.getCode()!=QType::ANY;
-    int hits=0;
-    bool relevantNS=false;
-    bool sawDS=false;
-    bool crossedZoneCut = false;
-    while(B.get(rr)) {
-      if(rr.qtype.getCode() == QType::NS && p->qtype.getCode() != QType::NS) { // possible retargeting
-        relevantNS=true;
-      }
-
-      if(rr.qtype.getCode()==QType::DS && p->qtype.getCode() == QType::NS && p->d_dnssecOk) {
-        sawDS = true;
-        r->addRecord(rr);
-      }
-
-      if(rr.qtype.getCode()!=QType::NS || p->qtype.getCode()==QType::NS)
-        hits++;
-      if(!rfound && rr.qtype.getCode()==QType::CNAME) {
-        found=true;
-        r->addRecord(rr);
-        target=rr.content; // for retargeting
-      }
-      if(shortcut && !found && rr.qtype==p->qtype) {
-        if(!rr.auth) {
-        // no idea why this if is here
-        }
-         
-        rfound=true;
-        r->addRecord(rr);
-      }
-    }
-
-    if(crossedZoneCut) {
-      DLOG(L<<"Should return NS records, and this A/AAAA record in the additional section.."<<endl);
-    }
-
-    if(!sawDS && p->qtype.getCode() == QType::NS && p->d_dnssecOk && rfound) {
-      addNSECX(p, r, p->qdomain, "", 2); // make it 'official' that we have no DS
-    }
-
-    if(hits && !relevantNS && !found && !rfound && shortcut ) { // XXX FIXME !numloops. we found matching qnames but not a qtype
-      DLOG(L<<"Found matching qname, but not the qtype"<<endl);
-      return 2;
-    }
-
-    if(rfound)
-      return 1; // ANY lookup found the right answer immediately
-
-    if(found) {
-      if(p->qtype.getCode()==QType::CNAME) // they really wanted a CNAME!
-        return 1;
-      DLOG(L<<"Looping because of a CNAME to "<<target<<endl);
-      found=false;
-    }
-    else 
-      break;
-  }
-
-  // we now have what we really search for ready in 'target'
-  return 0;
-}
-
-#endif
 
 /* Semantics: