diff --git a/Target.cc b/Target.cc index 0cb9153ec..9c5917675 100644 --- a/Target.cc +++ b/Target.cc @@ -124,7 +124,7 @@ void Target::Initialize() { distance = -1; FPR = NULL; osscan_flag = OS_NOTPERF; - wierd_responses = flags = 0; + weird_responses = flags = 0; memset(&to, 0, sizeof(to)); memset(&targetsock, 0, sizeof(targetsock)); memset(&sourcesock, 0, sizeof(sourcesock)); diff --git a/Target.h b/Target.h index d55eb574b..c302c76c9 100644 --- a/Target.h +++ b/Target.h @@ -256,8 +256,8 @@ class Target { // unsigned int up; // unsigned int down; - int wierd_responses; /* echo responses from other addresses, Ie a network broadcast address */ - unsigned int flags; /* HOST_UP, HOST_DOWN, HOST_FIREWALLED, HOST_BROADCAST (instead of HOST_BROADCAST use wierd_responses */ + int weird_responses; /* echo responses from other addresses, Ie a network broadcast address */ + unsigned int flags; /* HOST_UP, HOST_DOWN, HOST_FIREWALLED, HOST_BROADCAST (instead of HOST_BROADCAST use weird_responses */ struct timeout_info to; char *hostname; // Null if unable to resolve or unset char * targetname; // The name of the target host given on the commmand line if it is a named host diff --git a/nmap.cc b/nmap.cc index 29b6a5d7d..53fd686dc 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1646,7 +1646,7 @@ int nmap_main(int argc, char *argv[]) { currenths->setSourceSockAddr(&ss, sslen); } - /* I used to check that !currenths->wierd_responses, but in some + /* I used to check that !currenths->weird_responses, but in some rare cases, such IPs CAN be port successfully scanned and even connected to */ if (!(currenths->flags & HOST_UP)) { delete currenths; diff --git a/nmap.h b/nmap.h index 8e60cb3af..74b26cae3 100644 --- a/nmap.h +++ b/nmap.h @@ -333,7 +333,7 @@ void *realloc(); #define HOST_UP 1 #define HOST_DOWN 2 #define HOST_FIREWALLED 4 -#define HOST_BROADCAST 8 /* use the wierd_responses member of hoststruct instead */ +#define HOST_BROADCAST 8 /* use the weird_responses member of hoststruct instead */ #define PINGTYPE_UNKNOWN 0 #define PINGTYPE_NONE 1 diff --git a/nse_main.cc b/nse_main.cc index 848fcb5cd..0e9052bcb 100644 --- a/nse_main.cc +++ b/nse_main.cc @@ -418,7 +418,7 @@ int process_mainloop(lua_State *L) { if(o.verbose > 1 || o.debugging) progress.printStats(done, NULL); else - progress.printStatsIfNeccessary(done, NULL); + progress.printStatsIfNecessary(done, NULL); }) gettimeofday(&now, NULL); diff --git a/output.cc b/output.cc index a0ad21a8f..5a9ac3d9d 100644 --- a/output.cc +++ b/output.cc @@ -1358,21 +1358,21 @@ void write_host_status(Target *currenths, int resolve_all) { write_xml_initial_hostinfo(currenths, "unknown"); } - else if (currenths->wierd_responses) { /* SMURF ADDRESS */ + else if (currenths->weird_responses) { /* SMURF ADDRESS */ /* Write xml "down" or "up" based on flags and the smurf info */ write_xml_initial_hostinfo(currenths, (currenths->flags & HOST_UP)? "up" : "down"); log_write(LOG_XML, "\n", - currenths->wierd_responses); - log_write(LOG_MACHINE,"Host: %s (%s)\tStatus: Smurf (%d responses)\n", currenths->targetipstr(), currenths->HostName(), currenths->wierd_responses); + currenths->weird_responses); + log_write(LOG_MACHINE,"Host: %s (%s)\tStatus: Smurf (%d responses)\n", currenths->targetipstr(), currenths->HostName(), currenths->weird_responses); if (o.pingscan) - log_write(LOG_PLAIN,"Host %s seems to be a subnet broadcast address (returned %d extra pings).%s\n", currenths->NameIP(hostname, sizeof(hostname)), currenths->wierd_responses, + log_write(LOG_PLAIN,"Host %s seems to be a subnet broadcast address (returned %d extra pings).%s\n", currenths->NameIP(hostname, sizeof(hostname)), currenths->weird_responses, (currenths->flags & HOST_UP)? " Note -- the actual IP also responded." : ""); else { log_write(LOG_PLAIN,"Host %s seems to be a subnet broadcast address (returned %d extra pings). %s.\n", currenths->NameIP(hostname, sizeof(hostname)), - currenths->wierd_responses, + currenths->weird_responses, (currenths->flags & HOST_UP)? " Still scanning it due to ping response from its own IP" : "Skipping host"); diff --git a/scan_engine.cc b/scan_engine.cc index fd07c06d7..4f006e0a1 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -2180,7 +2180,7 @@ bool HostScanStats::completed() { /* With ping scan, we are done once we know the host is up or down. */ if (USI->ping_scan && ((target->flags & HOST_UP) - || (target->flags & HOST_DOWN) || target->wierd_responses)) { + || (target->flags & HOST_DOWN) || target->weird_responses)) { return true; } @@ -3336,7 +3336,7 @@ static void printAnyStats(UltraScanInfo *USI) { } if (USI->SPM->mayBePrinted(&USI->now)) - USI->SPM->printStatsIfNeccessary(USI->getCompletionFraction(), &USI->now); + USI->SPM->printStatsIfNecessary(USI->getCompletionFraction(), &USI->now); } /* Does a select() call and handles all of the results. This handles both host @@ -4157,14 +4157,14 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { probeI = hss->probes_outstanding.end(); listsz = hss->num_probes_outstanding(); - /* A check for wierd_responses is needed here. This is not currently + /* A check for weird_responses is needed here. This is not currently possible because we don't have a good way to look up the original target of an ICMP probe based on the response. (massping encoded an array index in the ICMP sequence, which won't work here.) Once we've found the host that sent the probe that elicited the response, the - test for wierd_responses is + test for weird_responses is if (sending_host->v4host().s_addr != ip->ip_src.s_addr) - hss->target->wierd_responses++; + hss->target->weird_responses++; (That is, the target that sent the probe is not the same one that sent the response.) */ diff --git a/service_scan.cc b/service_scan.cc index a1bc2f7f8..4f84ae6fb 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -1865,7 +1865,7 @@ static void considerPrintingStats(ServiceGroup *SG) { /* Perhaps this should be made more complex, but I suppose it should be good enough for now. */ if (SG->SPM->mayBePrinted(nsock_gettimeofday())) { - SG->SPM->printStatsIfNeccessary(SG->services_finished.size() / ((double)SG->services_remaining.size() + SG->services_in_progress.size() + SG->services_finished.size()), nsock_gettimeofday()); + SG->SPM->printStatsIfNecessary(SG->services_finished.size() / ((double)SG->services_remaining.size() + SG->services_in_progress.size() + SG->services_finished.size()), nsock_gettimeofday()); } } diff --git a/timing.cc b/timing.cc index 7a35d6273..ef45a3a25 100644 --- a/timing.cc +++ b/timing.cc @@ -460,7 +460,7 @@ ScanProgressMeter::~ScanProgressMeter() { might as well check this before spending much time computing progress info. now can be NULL if caller doesn't have the current time handy. Just because this function returns true does not mean - that the next printStatsIfNeccessary will always print something. + that the next printStatsIfNecessary will always print something. It depends on whether time estimates have changed, which this func doesn't even know about. */ bool ScanProgressMeter::mayBePrinted(const struct timeval *now) { @@ -495,7 +495,7 @@ bool ScanProgressMeter::mayBePrinted(const struct timeval *now) { so if mayBePrinted() is true, and it seems reasonable to do so because the estimate has changed significantly. Returns whether or not a line was printed.*/ -bool ScanProgressMeter::printStatsIfNeccessary(double perc_done, +bool ScanProgressMeter::printStatsIfNecessary(double perc_done, const struct timeval *now) { struct timeval tvtmp; long time_used_ms; diff --git a/timing.h b/timing.h index 2f6a743c5..8ddeac71d 100644 --- a/timing.h +++ b/timing.h @@ -191,7 +191,7 @@ class ScanProgressMeter { might as well check this before spending much time computing progress info. now can be NULL if caller doesn't have the current time handy. Just because this function returns true does not mean - that the next printStatsIfNeccessary will always print something. + that the next printStatsIfNecessary will always print something. It depends on whether time estimates have changed, which this func doesn't even know about. */ bool mayBePrinted(const struct timeval *now); @@ -200,7 +200,7 @@ class ScanProgressMeter { so if mayBePrinted() is true, and it seems reasonable to do so because the estimate has changed significantly. Returns whether or not a line was printed.*/ - bool printStatsIfNeccessary(double perc_done, const struct timeval *now); + bool printStatsIfNecessary(double perc_done, const struct timeval *now); /* Prints an estimate of when this scan will complete. */ bool printStats(double perc_done, const struct timeval *now); @@ -210,7 +210,7 @@ class ScanProgressMeter { struct timeval begin; /* When this ScanProgressMeter was instantiated */ private: - struct timeval last_print_test; /* Last time printStatsIfNeccessary was called */ + struct timeval last_print_test; /* Last time printStatsIfNecessary was called */ struct timeval last_print; /* The most recent time the ETC was printed */ char *scantypestr; struct timeval last_est; /* The latest PRINTED estimate */