mirror of
https://github.com/nmap/nmap.git
synced 2026-08-28 12:31:12 +00:00
Correctly treat A queries as alt for -6 scans, AAAA alt for -4
This commit is contained in:
parent
50ceac5753
commit
1e964d30f5
1 changed files with 11 additions and 1 deletions
12
nmap_dns.cc
12
nmap_dns.cc
|
|
@ -645,6 +645,16 @@ static int deal_with_timedout_reads(bool adjust_timing) {
|
|||
|
||||
}
|
||||
|
||||
static bool is_primary_req(const request *req) {
|
||||
if (req->alt_req) {
|
||||
return (o.af() == AF_INET6);
|
||||
}
|
||||
else if (req->targ->type == DNS::ANY) {
|
||||
return (o.af() == AF_INET);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void process_request(int action, info &reqinfo) {
|
||||
request *tpreq = reqinfo.tpreq;
|
||||
dns_server *server = reqinfo.server;
|
||||
|
|
@ -660,7 +670,7 @@ static void process_request(int action, info &reqinfo) {
|
|||
server->in_process.remove(tpreq);
|
||||
server->reqs_on_wire--;
|
||||
total_reqs--;
|
||||
if (action == ACTION_SYSTEM_RESOLVE && !tpreq->alt_req) {
|
||||
if (action == ACTION_SYSTEM_RESOLVE && is_primary_req(tpreq)) {
|
||||
deferred_reqs.push_back(tpreq);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue