diff -urpb nmap-3.78/scan_engine.cc nmap-3.78mm/scan_engine.cc --- nmap-3.78/scan_engine.cc 2004-11-24 21:13:01.000000000 +0100 +++ nmap-3.78mm/scan_engine.cc 2004-12-19 13:30:43.000000000 +0100 @@ -1475,7 +1475,11 @@ static void ultrascan_port_update(UltraS probe = *probeI; - if (rcvdtime) ultrascan_adjust_times(USI, hss, probe, rcvdtime); + /* ICMP unreachables are often rate-limited (RFC 1812) + * or generated by host in-between. + * If we can get the result without them, do not slow down (or up) */ + if (rcvdtime && !noresp_open_scan && newstate != PORT_FILTERED) + ultrascan_adjust_times(USI, hss, probe, rcvdtime); if (probe->type == UltraProbe::UP_IP) { if (USI->prot_scan) @@ -1570,9 +1574,11 @@ static void ultrascan_port_update(UltraS } /* The rcvdtime check is because this func is called that way when - we give up on a probe because of too many retransmissions. */ + we give up on a probe because of too many retransmissions. + We don't care ICMP/PORT_FILTERED in some type of scans because + they are often rate-limited and we don't need them anyway */ if (oldstate != newstate && probe->tryno > hss->max_successful_tryno - && rcvdtime) { + && rcvdtime && !noresp_open_scan && newstate != PORT_FILTERED) { hss->max_successful_tryno = probe->tryno; if (o.debugging) log_write(LOG_STDOUT, "Increased max_successful_tryno for %s to %d (packet drop)\n", hss->target->targetipstr(), hss->max_successful_tryno);