From 56d83f74a2a090cbad9a5992ae3013ae9833032a Mon Sep 17 00:00:00 2001 From: kris Date: Thu, 5 Mar 2009 22:13:11 +0000 Subject: [PATCH] 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 :) --- nmap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmap.cc b/nmap.cc index f5ee686e9..d91250117 100644 --- a/nmap.cc +++ b/nmap.cc @@ -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); }