b39422
From 9be04e6fac3f4ee8fa08d3671dac41d2156d2ced Mon Sep 17 00:00:00 2001
b39422
From: Wouter Wijngaards <wouter@nlnetlabs.nl>
b39422
Date: Thu, 27 Sep 2018 08:19:29 +0000
b39422
Subject: [PATCH] - Fix #4188: IPv6 forwarders without ipv6 result in SERVFAIL,
b39422
 fixes   qname minimisation with a forwarder when connectivity has issues  
b39422
 from rejecting responses.
b39422
b39422
git-svn-id: file:///svn/unbound/trunk@4916 be551aaa-1e26-0410-a405-d3ace91eadb9
b39422
---
b39422
 iterator/iterator.c | 6 ++++--
b39422
 1 file changed, 4 insertions(+), 2 deletions(-)
b39422
b39422
diff --git a/iterator/iterator.c b/iterator/iterator.c
b39422
index 7baf92b7..2f26bd33 100644
b39422
--- a/iterator/iterator.c
b39422
+++ b/iterator/iterator.c
b39422
@@ -2174,7 +2174,8 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
b39422
 		return 0;
b39422
 	}
b39422
 
b39422
-	if(iq->minimisation_state == INIT_MINIMISE_STATE) {
b39422
+	if(iq->minimisation_state == INIT_MINIMISE_STATE
b39422
+		&& !(iq->chase_flags & BIT_RD)) {
b39422
 		/* (Re)set qinfo_out to (new) delegation point, except when
b39422
 		 * qinfo_out is already a subdomain of dp. This happens when
b39422
 		 * increasing by more than one label at once (QNAMEs with more
b39422
@@ -2715,7 +2716,8 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
b39422
 			sock_list_insert(&qstate->reply_origin, 
b39422
 				&qstate->reply->addr, qstate->reply->addrlen, 
b39422
 				qstate->region);
b39422
-		if(iq->minimisation_state != DONOT_MINIMISE_STATE) {
b39422
+		if(iq->minimisation_state != DONOT_MINIMISE_STATE
b39422
+			&& !(iq->chase_flags & BIT_RD)) {
b39422
 			if(FLAGS_GET_RCODE(iq->response->rep->flags) != 
b39422
 				LDNS_RCODE_NOERROR) {
b39422
 				if(qstate->env->cfg->qname_minimisation_strict)
b39422
-- 
b39422
2.14.4
b39422