1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 21:21:31 +00:00

Fix coding style - only run begin_sniffer in case of a raw scan.

This commit is contained in:
d33tah
2013-12-30 18:56:43 +00:00
parent 0ba3dc0be7
commit 36fc84ab31

View File

@@ -5516,9 +5516,6 @@ static void begin_sniffer(UltraScanInfo *USI, std::vector<Target *> &Targets) {
unsigned int targetno;
bool doIndividual = Targets.size() <= 20; // Don't bother IP limits if scanning huge # of hosts
if (!USI->isRawScan())
return; /* No sniffer needed! */
if (doIndividual) {
for (targetno = 0; targetno < Targets.size(); targetno++) {
dst_hosts += (targetno == 0) ? "" : " or ";
@@ -5799,7 +5796,10 @@ void ultra_scan(std::vector<Target *> &Targets, struct scan_lists *ports,
log_write(LOG_STDOUT, "Scanning %s [%d port%s%s]\n", targetstr, USI.gstats->numprobes, (USI.gstats->numprobes != 1) ? "s" : "", plural ? "/host" : "");
}
begin_sniffer(&USI, Targets);
if (USI.isRawScan())
begin_sniffer(&USI, Targets);
/* Otherwise, no sniffer needed! */
while (!USI.incompleteHostsEmpty()) {
doAnyPings(&USI);
doAnyOutstandingRetransmits(&USI); // Retransmits from probes_outstanding