1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-26 01:19:03 +00:00

Don't allow matching probes that haven't been sent.

This is a reversion of r26232 and r26230, which were themselves
reversions of r26201 and r26202 respectively, in
https://svn.nmap.org/nmap-exp/luis/nmap-os6@26232.

This code has gone back and forth a few times. Looking at it again, I
still think this way is more correct. At any rate, the other way
demonstrably leads to rare assertion failures (which are protecting
against a nonsensical subtraction with an all-zero timeval).
This commit is contained in:
david
2012-03-22 01:30:47 +00:00
parent 7c63fb3236
commit 9b28395cd8
2 changed files with 9 additions and 2 deletions

View File

@@ -2000,7 +2000,6 @@ int FPHost6::schedule() {
this->fp_probes[i].getRetransmissions());
}
this->fp_probes[i].incrementRetransmissions();
this->fp_probes[i].resetTimeSent();
this->netctl->scheduleProbe(&(this->fp_probes[i]), 0);
break;
}
@@ -2128,7 +2127,6 @@ int FPHost6::schedule() {
int whentostart = get_random_u16()%100;
for (size_t l = 0; l < this->timed_probes; l++) {
this->fp_probes[l].incrementRetransmissions();
this->fp_probes[l].resetTimeSent();
this->netctl->scheduleProbe(&(this->fp_probes[l]), whentostart + l*100);
}
if (o.debugging > 3 && this->timed_probes > 0)
@@ -2516,6 +2514,11 @@ void FPProbe::reset() {
* PacketParser::is_response(). Check there for a list of matched packets and
* some usage examples.*/
bool FPProbe::isResponse(PacketElement *rcvd) {
/* If we don't have a record of even sending this probe, no packet can be a
response. */
if (this->pkt_time.tv_sec == 0 && this->pkt_time.tv_usec == 0)
return false;
return PacketParser::is_response(this->pkt, rcvd);
}