Created
April 26, 2013 11:41
-
-
Save Habbie/5466712 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
Index: regression-tests/wildcard-overlaps-delegation/expected_result | |
=================================================================== | |
--- regression-tests/wildcard-overlaps-delegation/expected_result (revision 0) | |
+++ regression-tests/wildcard-overlaps-delegation/expected_result (revision 0) | |
@@ -0,0 +1,3 @@ | |
+1 sub.test.test.com. IN NS 3600 ns-test.example.net.test.com. | |
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 0, opcode: 0 | |
+Reply to question for qname='www.sub.test.test.com.', qtype=A | |
Index: regression-tests/wildcard-overlaps-delegation/description | |
=================================================================== | |
--- regression-tests/wildcard-overlaps-delegation/description (revision 0) | |
+++ regression-tests/wildcard-overlaps-delegation/description (revision 0) | |
@@ -0,0 +1 @@ | |
+Make sure that NS delegations manage to override a wildcard. | |
Index: regression-tests/wildcard-overlaps-delegation/command | |
=================================================================== | |
--- regression-tests/wildcard-overlaps-delegation/command (revision 0) | |
+++ regression-tests/wildcard-overlaps-delegation/command (revision 0) | |
@@ -0,0 +1,3 @@ | |
+#!/bin/sh | |
+ | |
+cleandig www.sub.test.test.com A | |
Property changes on: regression-tests/wildcard-overlaps-delegation/command | |
___________________________________________________________________ | |
Added: svn:executable | |
+ * | |
Index: regression-tests/test.com | |
=================================================================== | |
--- regression-tests/test.com (revision 2283) | |
+++ regression-tests/test.com (working copy) | |
@@ -16,6 +16,7 @@ | |
IN RP ahu.ds9a.nl counter.test.com. | |
*.test IN CNAME server1 | |
www.test IN A 4.3.2.1 | |
+sub.test IN NS ns-test.example.net | |
enum IN NAPTR 100 50 "u" "e2u+sip" "" testuser@domain.com. | |
counter IN A 1.1.1.5 | |
_ldap._tcp.dc IN SRV 0 100 389 server1 | |
Index: regression-tests/named.conf | |
=================================================================== | |
--- regression-tests/named.conf (revision 2283) | |
+++ regression-tests/named.conf (working copy) | |
@@ -11,6 +11,10 @@ | |
type master; | |
file "./example.com"; | |
}; | |
+zone "sub.example.com"{ | |
+ type master; | |
+ file "./sub.example.com"; | |
+}; | |
zone "test.com"{ | |
type master; | |
Index: pdns/packethandler.cc | |
=================================================================== | |
--- pdns/packethandler.cc (revision 2283) | |
+++ pdns/packethandler.cc (working copy) | |
@@ -1305,7 +1305,12 @@ | |
DLOG(L<<"After first ANY query for '"<<target<<"', id="<<sd.domain_id<<": weDone="<<weDone<<", weHaveUnauth="<<weHaveUnauth<<", weRedirected="<<weRedirected<<endl); | |
if(rrset.empty()) { | |
- // try wildcards, and if they don't work, go look for NS records | |
+ // try NS referrals, and if they don't work, go look for wildcards | |
+ | |
+ DLOG(L<<"Found nothing in the ANY and wildcards, let's try NS referral"<<endl); | |
+ if(tryReferral(p, r, sd, target)) | |
+ goto sendit; | |
+ | |
DLOG(L<<Logger::Warning<<"Found nothing in the ANY, but let's try wildcards.."<<endl); | |
bool wereRetargeted(false), nodata(false); | |
if(tryWildcard(p, r, sd, target, wereRetargeted, nodata)) { | |
@@ -1317,10 +1322,11 @@ | |
makeNOError(p, r, target, sd); | |
goto sendit; | |
} | |
- DLOG(L<<"Found nothing in the ANY and wildcards, let's try NS referral"<<endl); | |
- if(!tryReferral(p, r, sd, target)) | |
+ else | |
+ { | |
makeNXDomain(p, r, target, sd); | |
- | |
+ } | |
+ | |
goto sendit; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment