From: Bert Hubert Date: Mon, 15 Mar 2010 21:38:31 +0000 (+0000) Subject: add testcase for wildcard CNAME pointing to a record that does not have the type... X-Git-Tag: rec-3.3~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3add44189d938d8a44afb55ff0ed7c1de9ecf10;p=pdns add testcase for wildcard CNAME pointing to a record that does not have the type requested, plus fix this bug git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1543 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 84b623e37..fd8e2680f 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -653,6 +653,7 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) goto sendit; int mret; + retargeted:; if(retargetcount++>10) { L<clearRecords(); } if(d_doFancyRecords) { // MBOXFW, URL <- fake records, emulated with MX and A diff --git a/regression-tests/cname-and-wildcard-but-no-correct-type/command b/regression-tests/cname-and-wildcard-but-no-correct-type/command new file mode 100755 index 000000000..40d2783b0 --- /dev/null +++ b/regression-tests/cname-and-wildcard-but-no-correct-type/command @@ -0,0 +1,3 @@ +#!/bin/sh + +cleandig yo.test.test.com AAAA diff --git a/regression-tests/cname-and-wildcard-but-no-correct-type/description b/regression-tests/cname-and-wildcard-but-no-correct-type/description new file mode 100644 index 000000000..6838a6b91 --- /dev/null +++ b/regression-tests/cname-and-wildcard-but-no-correct-type/description @@ -0,0 +1,3 @@ +If a CNAME wildcard is present, and it matches, but points to a record that +does not have the requested type, a CNAME should be emitted plus a SOA to +indicate no match with the right record diff --git a/regression-tests/cname-and-wildcard-but-no-correct-type/expected_result b/regression-tests/cname-and-wildcard-but-no-correct-type/expected_result new file mode 100644 index 000000000..a28dfdf8d --- /dev/null +++ b/regression-tests/cname-and-wildcard-but-no-correct-type/expected_result @@ -0,0 +1,4 @@ +0 yo.test.test.com. IN CNAME 3600 server1.test.com. +1 test.com. IN SOA 3600 ns1.test.com. ahu.example.com. 2005092501 28800 7200 604800 86400 +Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='yo.test.test.com.', qtype=AAAA