From 30863f2f150f4afc1dd15fe49eed55b398e08b76 Mon Sep 17 00:00:00 2001 From: fyodor Date: Tue, 19 Jul 2005 08:50:58 +0000 Subject: [PATCH] fixed a little bug --- targets.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/targets.cc b/targets.cc index 817dde9c3..1445c00b2 100644 --- a/targets.cc +++ b/targets.cc @@ -294,7 +294,7 @@ void returnhost(HostGroupState *hs) { Target *nexthost(HostGroupState *hs, TargetGroup *exclude_group, struct scan_lists *ports, int *pingtype) { -int hidx; +int hidx = 0; int i; struct sockaddr_storage ss; size_t sslen; @@ -415,8 +415,9 @@ if (hs->randomize) { if ((o.sendpref & PACKET_SEND_ETH) && hs->hostbatch[0]->ifType() == devt_ethernet) { - if (!setTargetNextHopMAC(hs->hostbatch[hidx])) - fatal("%s: Failed to determine dst MAC address for target %s", + for(i=0; i < hs->current_batch_sz; i++) + if (!setTargetNextHopMAC(hs->hostbatch[i])) + fatal("%s: Failed to determine dst MAC address for target %s", __FUNCTION__, hs->hostbatch[hidx]->NameIP()); }