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

Don't call the meaningless gettoppts if we're doing a ping or list scan. This

keeps the following debugging line from being printed in these modes:

	PORTS: Using top 1000 ports found open (TCP:0, UDP:0)

This also speeds these up because it doesn't necessarily have to read and parse
nmap-services.  Going from 0.25s to 0.04s for listing a /24 sounds good to me :)
This commit is contained in:
kris
2009-03-05 22:13:11 +00:00
parent 8424be764d
commit 56d83f74a2

View File

@@ -1347,7 +1347,7 @@ int nmap_main(int argc, char *argv[]) {
if (o.ipprotscan) {
if (portlist) getpts(portlist, &ports);
else getpts((char *) (o.fastscan ? "[P:0-]" : "0-"), &ports); // Default protocols to scan
} else {
} else if (!o.pingscan && !o.listscan) {
gettoppts(o.topportlevel, portlist, &ports);
}