From 01e9f4d599b197b783026c22fb15ccd80f587823 Mon Sep 17 00:00:00 2001 From: fyodor Date: Tue, 3 May 2005 09:13:59 +0000 Subject: [PATCH] Some critical bugfixes (things I broke when adding ARP scanning --- scan_engine.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scan_engine.cc b/scan_engine.cc index 5f585efa5..68108baa6 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -554,6 +554,7 @@ UltraProbe::UltraProbe() { type = UP_UNSET; IP = NULL; CP = NULL; + AP = NULL; tryno = 0; timedout = false; retransmitted = false; @@ -1733,7 +1734,7 @@ static void ultrascan_port_update(UltraScanInfo *USI, HostScanStats *hss, if (USI->tcp_scan) { hss->pingprobe.type = probespec::PS_TCP; hss->pingprobe.portno = portno; - if (USI->scantype = CONNECT_SCAN) + if (USI->scantype == CONNECT_SCAN) hss->pingprobe.tcp_flags = TH_SYN; else hss->pingprobe.tcp_flags = probe->IP->tcp->th_flags; } else if (USI->udp_scan) { @@ -2505,7 +2506,10 @@ static bool get_arp_result(UltraScanInfo *USI, struct timeval *stime) { /* Add found HW address for target */ hss->target->setMACAddress(rcvdmac); - assert(!hss->probes_outstanding.empty()); + if (hss->probes_outstanding.empty()) { + continue; + /* TODO: I suppose I should really mark the @@# host as up */ + } probeI = hss->probes_outstanding.end(); probeI--; ultrascan_host_update(USI, hss, probeI, HOST_UP, &rcvdtime);