mirror of
https://github.com/nmap/nmap.git
synced 2026-11-20 08:40:36 +08:00
Prevent -iR from running forever if all addresses are excluded
This commit is contained in:
+7
-1
@@ -464,9 +464,15 @@ bool HostGroupState::get_next_host(struct sockaddr_storage *ss, size_t *sslen, s
|
||||
}
|
||||
/* Check exclude list. */
|
||||
if (!addrset_contains(exclude_group, (const struct sockaddr *) ss)) {
|
||||
current_group.reject_last_host();
|
||||
break;
|
||||
}
|
||||
else {
|
||||
current_group.reject_last_host();
|
||||
if (addrset_matches_all(exclude_group, o.af())) {
|
||||
error("All %s addresses are excluded!", o.af() == AF_INET ? "IPv4" : "IPv6");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} while (true);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user