19b1ef
From 66b71679b78ad6cf2c4e5c8c1216b602e0fe1e9b Mon Sep 17 00:00:00 2001
19b1ef
From: Evan Hunt <each@isc.org>
19b1ef
Date: Thu, 20 Apr 2017 09:28:37 -0700
19b1ef
Subject: [PATCH] [master] nsupdate: send tkey queries to the right server
19b1ef
19b1ef
4588.	[bug]		nsupdate could send queries for TKEY to the wrong
19b1ef
			server when using GSSAPI. Thanks to Tomas Hozza.
19b1ef
			[RT #39893]
19b1ef
---
19b1ef
 bin/nsupdate/nsupdate.c | 10 ++++------
19b1ef
 1 file changed, 4 insertions(+), 6 deletions(-)
19b1ef
19b1ef
diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c
19b1ef
index 9572fd8..8fc5b20 100644
19b1ef
--- a/bin/nsupdate/nsupdate.c
19b1ef
+++ b/bin/nsupdate/nsupdate.c
19b1ef
@@ -2799,10 +2799,8 @@ start_gssrequest(dns_name_t *master) {
19b1ef
 		if (kserver == NULL)
19b1ef
 			fatal("out of memory");
19b1ef
 	}
19b1ef
-	if (servers == NULL)
19b1ef
-		get_addresses(namestr, dnsport, kserver, 1);
19b1ef
-	else
19b1ef
-		memmove(kserver, &servers[ns_inuse], sizeof(isc_sockaddr_t));
19b1ef
+
19b1ef
+	memmove(kserver, &master_servers[master_inuse], sizeof(isc_sockaddr_t));
19b1ef
 
19b1ef
 	dns_fixedname_init(&fname);
19b1ef
 	servname = dns_fixedname_name(&fname);
19b1ef
@@ -2947,11 +2945,11 @@ recvgss(isc_task_t *task, isc_event_t *event) {
19b1ef
 	}
19b1ef
 
19b1ef
 	if (eresult != ISC_R_SUCCESS) {
19b1ef
-		next_server("recvgss", addr, eresult);
19b1ef
+		next_master("recvgss", addr, eresult);
19b1ef
 		ddebug("Destroying request [%p]", request);
19b1ef
 		dns_request_destroy(&request);
19b1ef
 		dns_message_renderreset(tsigquery);
19b1ef
-		sendrequest(&servers[ns_inuse], tsigquery, &request);
19b1ef
+		sendrequest(&master_servers[master_inuse], tsigquery, &request);
19b1ef
 		isc_mem_put(gmctx, reqinfo, sizeof(nsu_gssinfo_t));
19b1ef
 		isc_event_free(&event);
19b1ef
 		return;
19b1ef
-- 
19b1ef
2.9.3
19b1ef