mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 06:01:28 +00:00
Fix coding style - only run begin_sniffer in case of a raw scan.
This commit is contained in:
@@ -5516,9 +5516,6 @@ static void begin_sniffer(UltraScanInfo *USI, std::vector<Target *> &Targets) {
|
|||||||
unsigned int targetno;
|
unsigned int targetno;
|
||||||
bool doIndividual = Targets.size() <= 20; // Don't bother IP limits if scanning huge # of hosts
|
bool doIndividual = Targets.size() <= 20; // Don't bother IP limits if scanning huge # of hosts
|
||||||
|
|
||||||
if (!USI->isRawScan())
|
|
||||||
return; /* No sniffer needed! */
|
|
||||||
|
|
||||||
if (doIndividual) {
|
if (doIndividual) {
|
||||||
for (targetno = 0; targetno < Targets.size(); targetno++) {
|
for (targetno = 0; targetno < Targets.size(); targetno++) {
|
||||||
dst_hosts += (targetno == 0) ? "" : " or ";
|
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" : "");
|
log_write(LOG_STDOUT, "Scanning %s [%d port%s%s]\n", targetstr, USI.gstats->numprobes, (USI.gstats->numprobes != 1) ? "s" : "", plural ? "/host" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (USI.isRawScan())
|
||||||
begin_sniffer(&USI, Targets);
|
begin_sniffer(&USI, Targets);
|
||||||
|
/* Otherwise, no sniffer needed! */
|
||||||
|
|
||||||
while (!USI.incompleteHostsEmpty()) {
|
while (!USI.incompleteHostsEmpty()) {
|
||||||
doAnyPings(&USI);
|
doAnyPings(&USI);
|
||||||
doAnyOutstandingRetransmits(&USI); // Retransmits from probes_outstanding
|
doAnyOutstandingRetransmits(&USI); // Retransmits from probes_outstanding
|
||||||
|
|||||||
Reference in New Issue
Block a user