Changeset 1147
- Timestamp:
- 03/01/08 23:11:26 (5 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/packethandler.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/packethandler.cc
r1113 r1147 1 /*1 /* 2 2 PowerDNS Versatile Database Driven Nameserver 3 Copyright (C) 2002-200 7PowerDNS.COM BV3 Copyright (C) 2002-2008 PowerDNS.COM BV 4 4 5 5 This program is free software; you can redistribute it and/or modify … … 34 34 #include "dnsproxy.hh" 35 35 36 36 37 extern StatBag S; 37 38 extern PacketCache PC; … … 264 265 string subdomain=target; 265 266 string::size_type pos; 267 266 268 while((pos=subdomain.find("."))!=string::npos) { 267 269 subdomain=subdomain.substr(pos+1); … … 305 307 } 306 308 if(found) { 307 DLOG(L<<"Wildcard match on '"<<string("*.")+subdomain<<"'"<< endl);309 DLOG(L<<"Wildcard match on '"<<string("*.")+subdomain<<"'"<<", retargeted="<<retargeted<<endl); 308 310 return retargeted ? 2 : 1; 309 311 } 310 312 } 313 DLOG(L<<"Returning no hit for '"<<string("*.")+subdomain<<"'"<<endl); 311 314 return 0; 312 315 } … … 385 388 bool shortcut=p->qtype.getCode()!=QType::SOA && p->qtype.getCode()!=QType::ANY; 386 389 int hits=0; 390 bool relevantNS=false; 387 391 388 392 while(B.get(rr)) { 393 if(rr.qtype.getCode() == QType::NS && p->qtype.getCode() != QType::NS) { // possible retargeting 394 relevantNS=true; 395 } 389 396 if(rr.qtype.getCode()!=QType::NS || p->qtype.getCode()==QType::NS) 390 397 hits++; … … 399 406 } 400 407 } 401 if(hits && ! found && !rfound && shortcut ) { // we found matching qnames but not a qtype408 if(hits && !relevantNS && !found && !rfound && shortcut ) { // we found matching qnames but not a qtype 402 409 DLOG(L<<"Found matching qname, but not the qtype"<<endl); 403 410 return 2; … … 681 688 rr.d_place=DNSResourceRecord::AUTHORITY; 682 689 r->addRecord(rr); 690 if(mret == 2) 691 goto sendit; 683 692 } 684 693 }