]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- fix retry sequence if prime hints are recursion-lame.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 27 Apr 2010 11:10:35 +0000 (11:10 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 27 Apr 2010 11:10:35 +0000 (11:10 +0000)
git-svn-id: file:///svn/unbound/trunk@2099 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iterator.c
testdata/iter_hint_lame.rpl [new file with mode: 0644]

index c3d1c955a9cd251a94ad117dd916afffa105f18d..333181fabe8a8359285717ba978eca9bb12b4003 100644 (file)
@@ -1,5 +1,6 @@
 27 April 2010: Wouter
        - unbound-control get_option domain-insecure shows config file items.
+       - fix retry sequence if prime hints are recursion-lame.
 
 26 April 2010: Wouter
        - Compile fix using Sun Studio 12 compiler on Solaris 5.9, use
index b1a948d9f62d3202e87d17389002286cbde50571..08354e8f2056cbab51c592def28b4d61a95310a0 100644 (file)
@@ -1897,8 +1897,11 @@ static int
 processPrimeResponse(struct module_qstate* qstate, int id)
 {
        struct iter_qstate* iq = (struct iter_qstate*)qstate->minfo[id];
-       enum response_type type = response_type_from_server(0, iq->response, 
-               &iq->qchase, iq->dp);
+       enum response_type type;
+       iq->response->rep->flags &= ~(BIT_RD|BIT_RA); /* ignore rec-lame */
+       type = response_type_from_server(
+               (int)((iq->chase_flags&BIT_RD) || iq->chase_to_rd), 
+               iq->response, &iq->qchase, iq->dp);
        if(type == RESPONSE_TYPE_ANSWER) {
                qstate->return_rcode = LDNS_RCODE_NOERROR;
                qstate->return_msg = iq->response;
@@ -2230,7 +2233,7 @@ void
 iter_inform_super(struct module_qstate* qstate, int id, 
        struct module_qstate* super)
 {
-       if(super->qinfo.qclass == LDNS_RR_CLASS_ANY)
+       if(!qstate->is_priming && super->qinfo.qclass == LDNS_RR_CLASS_ANY)
                processClassResponse(qstate, id, super);
        else if(qstate->return_rcode != LDNS_RCODE_NOERROR)
                error_supers(qstate, id, super);
diff --git a/testdata/iter_hint_lame.rpl b/testdata/iter_hint_lame.rpl
new file mode 100644 (file)
index 0000000..8cbede1
--- /dev/null
@@ -0,0 +1,120 @@
+; config options
+server:
+       target-fetch-policy: "0 0 0 0 0"
+
+stub-zone:
+       name: "."
+       stub-addr: 193.0.14.129         # K.ROOT-SERVERS.NET.
+CONFIG_END
+
+SCENARIO_BEGIN Test iterative resolve with lame hints.
+
+; K.ROOT-SERVERS.NET.
+RANGE_BEGIN 0 100
+       ADDRESS 193.0.14.129 
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR RA NOERROR
+SECTION QUESTION
+. IN NS
+SECTION ANSWER
+. IN NS        K.ROOT-SERVERS.NET.
+SECTION ADDITIONAL
+K.ROOT-SERVERS.NET.    IN      A       193.0.14.129
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION AUTHORITY
+com.   IN NS   a.gtld-servers.net.
+SECTION ADDITIONAL
+a.gtld-servers.net.    IN      A       192.5.6.30
+ENTRY_END
+RANGE_END
+
+; a.gtld-servers.net.
+RANGE_BEGIN 0 100
+       ADDRESS 192.5.6.30
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+com. IN NS
+SECTION ANSWER
+com.   IN NS   a.gtld-servers.net.
+SECTION ADDITIONAL
+a.gtld-servers.net.    IN      A       192.5.6.30
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION AUTHORITY
+example.com.   IN NS   ns.example.com.
+SECTION ADDITIONAL
+ns.example.com.                IN      A       1.2.3.4
+ENTRY_END
+RANGE_END
+
+; ns.example.com.
+RANGE_BEGIN 0 100
+       ADDRESS 1.2.3.4
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+example.com. IN NS
+SECTION ANSWER
+example.com.   IN NS   ns.example.com.
+SECTION ADDITIONAL
+ns.example.com.                IN      A       1.2.3.4
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A  10.20.30.40
+SECTION AUTHORITY
+example.com.   IN NS   ns.example.com.
+SECTION ADDITIONAL
+ns.example.com.                IN      A       1.2.3.4
+ENTRY_END
+RANGE_END
+
+STEP 1 QUERY
+ENTRY_BEGIN
+REPLY RD
+SECTION QUESTION
+www.example.com. IN A
+ENTRY_END
+
+; recursion happens here.
+STEP 10 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A  10.20.30.40
+SECTION AUTHORITY
+example.com.   IN NS   ns.example.com.
+SECTION ADDITIONAL
+ns.example.com.                IN      A       1.2.3.4
+ENTRY_END
+
+SCENARIO_END