From b3b06477c339adc1a339156378875c478c38ee12 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 4 Jan 2009 01:20:05 +0000 Subject: [PATCH] Pull out the stuff that ignored timing for ICMP destination unreachables if the source address didn't match the target address. Fyodor correctly pointed out that this is wrong for UDP scans, when we need to slow down for a firewall sending unreachables to know which probes don't elicit one. I'm going to try something a little different in nmap-perf. --- scan_engine.cc | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scan_engine.cc b/scan_engine.cc index 8018b7b27..463947ee2 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -3971,13 +3971,6 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) { } current_reason = icmp->icmp_code+ER_ICMPCODE_MOD; if (newstate == PORT_UNKNOWN) break; - if (hss->target->v4hostip()->s_addr != ip->ip_src.s_addr) { - /* If it's not directly from the remote host we don't alter our - timing for it. */ - adjust_timing = false; - if (o.debugging > 2) - log_write(LOG_PLAIN, "ICMP response from %s is not from target (%s); not adjusting timing.\n", inet_ntoa(ip->ip_src), hss->target->targetipstr()); - } goodone = true; } } @@ -4389,9 +4382,6 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { } else { goodone = true; newstate = HOST_DOWN; - adjust_timing = false; - if (o.debugging > 2) - log_write(LOG_PLAIN, "ICMP response from %s is not from target (%s); not adjusting timing.\n", inet_ntoa(ip->ip_src), hss->target->targetipstr()); } if (o.debugging) { if (ping->code == 3)