shithub: riscv

Download patch

ref: c9e86d6b342bc68f174825178d57e1e171972f5f
parent: 5fbf53b467fa109dcec963f3404f8dc77199e82f
author: cinap_lenrek <[email protected]>
date: Thu Oct 11 14:57:14 EDT 2018

ndb/dnstcp: only lookup the expected address type in findserver()

theres no reason to lookup both A and AAAA records, as we already
know the type of srcip.

--- a/sys/src/cmd/ndb/dnstcp.c
+++ b/sys/src/cmd/ndb/dnstcp.c
@@ -265,8 +265,8 @@
 				return servers;
 			continue;
 		}
-		list = dnresolve(servers->name, Cin, Ta, req, nil, 0, Recurse, 0, nil);
-		rrcat(&list, dnresolve(servers->name, Cin, Taaaa, req, nil, 0, Recurse, 0, nil));
+		list = dnresolve(servers->name, Cin, isv4(srcip)? Ta: Taaaa,
+			req, nil, 0, Recurse, 0, nil);
 		for(rp = list; rp != nil; rp = rp->next){
 			if(parseip(ip, rp->ip->name) == -1)
 				continue;