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:
2
nmap.cc
2
nmap.cc
@@ -1347,7 +1347,7 @@ int nmap_main(int argc, char *argv[]) {
|
|||||||
if (o.ipprotscan) {
|
if (o.ipprotscan) {
|
||||||
if (portlist) getpts(portlist, &ports);
|
if (portlist) getpts(portlist, &ports);
|
||||||
else getpts((char *) (o.fastscan ? "[P:0-]" : "0-"), &ports); // Default protocols to scan
|
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);
|
gettoppts(o.topportlevel, portlist, &ports);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user