changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: dnstcp: temporarily switch on resolver mode so we can resolve the dnsslaves for axfr check

changeset 6865: 429eff304848
parent 6859: f1f3e27f4831
child 6866: 9781f1a24395
author: cinap_lenrek@felloff.net
date: Tue, 06 Nov 2018 04:31:48 +0100
files: sys/src/cmd/ndb/dnstcp.c
description: dnstcp: temporarily switch on resolver mode so we can resolve the dnsslaves for axfr check
     1.1--- a/sys/src/cmd/ndb/dnstcp.c
     1.2+++ b/sys/src/cmd/ndb/dnstcp.c
     1.3@@ -256,6 +256,7 @@ findserver(uchar *srcip, Server *servers
     1.4 {
     1.5 	uchar ip[IPaddrlen];
     1.6 	RR *list, *rp;
     1.7+	int tmp;
     1.8 
     1.9 	for(; servers != nil; servers = servers->next){
    1.10 		if(strcmp(ipattr(servers->name), "ip") == 0){
    1.11@@ -265,8 +266,13 @@ findserver(uchar *srcip, Server *servers
    1.12 				return servers;
    1.13 			continue;
    1.14 		}
    1.15+
    1.16+		tmp = cfg.resolver;
    1.17+		cfg.resolver = 1;
    1.18 		list = dnresolve(servers->name, Cin, isv4(srcip)? Ta: Taaaa,
    1.19 			req, nil, 0, Recurse, 0, nil);
    1.20+		cfg.resolver = tmp;
    1.21+
    1.22 		for(rp = list; rp != nil; rp = rp->next){
    1.23 			if(parseip(ip, rp->ip->name) == -1)
    1.24 				continue;