From 83cb7d60b99f652d5b7fc0f86a3f0dababaa6ff1 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 9 Feb 2009 18:29:57 +0000 Subject: [PATCH] Clean up usage of the goodseq variable for checking trynum and pingseq. Remove it from places it's not used. Limit its scope to the places it is used. Patch from Daniel Roethlisberger. --- scan_engine.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scan_engine.cc b/scan_engine.cc index 9be9f2a1c..46755ae1b 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -3761,7 +3761,6 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) { UltraProbe *probe = NULL; unsigned int trynum = 0; unsigned int pingseq = 0; - bool goodseq; int newstate = PORT_UNKNOWN; unsigned int probenum; unsigned int listsz; @@ -3849,9 +3848,9 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) { /* Find the probe that provoked this response. */ for (probenum = 0; probenum < listsz && !goodone; probenum++) { + bool goodseq = false; probeI--; probe = *probeI; - goodseq = false; if (o.af() != AF_INET || probe->protocol() != IPPROTO_TCP) continue; @@ -4034,7 +4033,6 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) { for(probenum = 0; probenum < listsz && !goodone; probenum++) { probeI--; probe = *probeI; - goodseq = false; newstate = PORT_UNKNOWN; if (o.af() != AF_INET || probe->protocol() != IPPROTO_UDP) @@ -4148,7 +4146,6 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { unsigned int trynum = 0; unsigned int pingseq = 0; unsigned int requiredbytes; - bool goodseq; int newstate = HOST_UNKNOWN; unsigned int probenum; unsigned int listsz; @@ -4309,7 +4306,6 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { for (probenum = 0; probenum < listsz; probenum++) { probeI--; probe = *probeI; - goodseq = false; if (o.af() != AF_INET || probe->protocol() != IPPROTO_TCP) continue; @@ -4397,7 +4393,6 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { for (probenum = 0; probenum < listsz; probenum++) { probeI--; probe = *probeI; - goodseq = false; if (o.af() != AF_INET || probe->protocol() != ip2->ip_p) continue; @@ -4468,9 +4463,9 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { /* Find the probe that provoked this response. */ for (probenum = 0; probenum < listsz && !goodone; probenum++) { + bool goodseq = false; probeI--; probe = *probeI; - goodseq = false; if (o.af() != AF_INET || probe->protocol() != IPPROTO_TCP) continue; @@ -4539,7 +4534,6 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { for(probenum = 0; probenum < listsz && !goodone; probenum++) { probeI--; probe = *probeI; - goodseq = false; if (o.af() != AF_INET || probe->protocol() != IPPROTO_UDP) continue;