ref: a66be233961cc2277a8b3ab4e386497db9933970
parent: 93e493f391a0635753b118e2312070fce7ad5b66
author: cinap_lenrek <[email protected]>
date: Mon Nov 5 23:31:48 EST 2018
dnstcp: temporarily switch on resolver mode so we can resolve the dnsslaves for axfr check
--- a/sys/src/cmd/ndb/dnstcp.c
+++ b/sys/src/cmd/ndb/dnstcp.c
@@ -256,6 +256,7 @@
{
uchar ip[IPaddrlen];
RR *list, *rp;
+ int tmp;
for(; servers != nil; servers = servers->next){
if(strcmp(ipattr(servers->name), "ip") == 0){
@@ -265,8 +266,13 @@
return servers;
continue;
}
+
+ tmp = cfg.resolver;
+ cfg.resolver = 1;
list = dnresolve(servers->name, Cin, isv4(srcip)? Ta: Taaaa,
req, nil, 0, Recurse, 0, nil);
+ cfg.resolver = tmp;
+
for(rp = list; rp != nil; rp = rp->next){
if(parseip(ip, rp->ip->name) == -1)
continue;