ipv4: Fix PVS 2464

Fix using local variable within a loop with a same name
as a variable controlling this loop.

Change-Id: Ie920807a56e51b32844ac13ff1d8c564466d3a83
Reviewed-on: https://review.haiku-os.org/751
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
Murai Takashi 2018-12-03 06:21:46 +09:00 committed by waddlesplash
parent f1e8678942
commit 07af264afa

View File

@ -497,10 +497,10 @@ dump_ipv4_header(ipv4_header &header)
static int
dump_ipv4_multicast(int argc, char** argv)
{
MulticastState::Iterator it = sMulticastState->GetIterator();
MulticastState::Iterator groupIterator = sMulticastState->GetIterator();
while (it.HasNext()) {
IPv4GroupInterface* state = it.Next();
while (groupIterator.HasNext()) {
IPv4GroupInterface* state = groupIterator.Next();
char addressBuffer[64];
@ -511,10 +511,11 @@ dump_ipv4_multicast(int argc, char** argv)
? "Exclude" : "Include");
int count = 0;
IPv4GroupInterface::AddressSet::Iterator it
IPv4GroupInterface::AddressSet::Iterator addressIterator
= state->Sources().GetIterator();
while (it.HasNext()) {
kprintf("%s%s", count > 0 ? ", " : "", print_address(&it.Next(),
while (addressIterator.HasNext()) {
kprintf("%s%s", count > 0 ? ", " : "",
print_address(&addressIterator.Next(),
addressBuffer, sizeof(addressBuffer)));
count++;
}