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.
This commit is contained in:
cinap_lenrek 2018-10-11 18:57:14 +02:00
parent 5fbf53b467
commit c9e86d6b34

View file

@ -265,8 +265,8 @@ findserver(uchar *srcip, Server *servers, Request *req)
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;