1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Keep resolved, scanned addresses separate from unscanned addresses.

This commit is contained in:
dmiller
2017-08-07 14:25:13 +00:00
parent 527c653a0b
commit a66e75173e
5 changed files with 32 additions and 35 deletions

View File

@@ -1443,17 +1443,14 @@ void write_host_header(Target *currenths) {
}
write_host_status(currenths);
if (currenths->TargetName() != NULL
&& currenths->resolved_addrs.size() > 1) {
const struct sockaddr_storage *hs_ss = currenths->TargetSockAddr();
&& !currenths->unscanned_addrs.empty()) {
log_write(LOG_PLAIN, "Other addresses for %s (not scanned):",
currenths->TargetName());
for (std::list<struct sockaddr_storage>::const_iterator it = currenths->resolved_addrs.begin(), end = currenths->resolved_addrs.end();
for (std::list<struct sockaddr_storage>::const_iterator it = currenths->unscanned_addrs.begin(), end = currenths->unscanned_addrs.end();
it != end; it++) {
struct sockaddr_storage ss = *it;
if (!sockaddr_storage_equal(&ss, hs_ss)) {
log_write(LOG_PLAIN, " %s", inet_ntop_ez(&ss, sizeof(ss)));
}
log_write(LOG_PLAIN, " %s", inet_ntop_ez(&ss, sizeof(ss)));
}
log_write(LOG_PLAIN, "\n");
}