Created
April 26, 2013 11:43
-
-
Save Habbie/5466779 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur pdns-3.1.org/pdns/packethandler.cc pdns-3.1/pdns/packethandler.cc | |
--- pdns-3.1.org/pdns/packethandler.cc 2012-07-29 21:27:04.998039695 +0200 | |
+++ pdns-3.1/pdns/packethandler.cc 2012-07-29 21:25:28.904166138 +0200 | |
@@ -314,24 +314,29 @@ | |
ret->clear(); | |
DNSResourceRecord rr; | |
string subdomain(target); | |
- while( chopOff( subdomain )) { | |
+ bool haveSomething=false; | |
+ | |
+ while ( chopOff( subdomain ) && !haveSomething ) { | |
B.lookup(QType(QType::ANY), "*."+subdomain, p, sd.domain_id); | |
- bool haveSomething=false; | |
while(B.get(rr)) { | |
if(rr.qtype == p->qtype ||rr.qtype.getCode() == QType::CNAME || p->qtype.getCode() == QType::ANY) | |
- ret->push_back(rr); | |
+ ret->push_back(rr); | |
wildcard="*."+subdomain; | |
haveSomething=true; | |
} | |
- | |
- if(haveSomething) | |
- return true; | |
- | |
- if(subdomain == sd.qname) // stop at SOA | |
+ | |
+ if ( subdomain == sd.qname || haveSomething ) // stop at SOA or result | |
break; | |
- } | |
- return false; | |
+ B.lookup(QType(QType::ANY), subdomain, p, sd.domain_id); | |
+ if (B.get(rr)) { | |
+ DLOG(L<<"No wildcard match, ancestor exists"<<endl); | |
+ while (B.get(rr)) ; | |
+ break; | |
+ } | |
+ } | |
+ | |
+ return haveSomething; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment