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 <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
f1e8678942
commit
07af264afa
@@ -497,10 +497,10 @@ dump_ipv4_header(ipv4_header &header)
|
|||||||
static int
|
static int
|
||||||
dump_ipv4_multicast(int argc, char** argv)
|
dump_ipv4_multicast(int argc, char** argv)
|
||||||
{
|
{
|
||||||
MulticastState::Iterator it = sMulticastState->GetIterator();
|
MulticastState::Iterator groupIterator = sMulticastState->GetIterator();
|
||||||
|
|
||||||
while (it.HasNext()) {
|
while (groupIterator.HasNext()) {
|
||||||
IPv4GroupInterface* state = it.Next();
|
IPv4GroupInterface* state = groupIterator.Next();
|
||||||
|
|
||||||
char addressBuffer[64];
|
char addressBuffer[64];
|
||||||
|
|
||||||
@@ -511,10 +511,11 @@ dump_ipv4_multicast(int argc, char** argv)
|
|||||||
? "Exclude" : "Include");
|
? "Exclude" : "Include");
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
IPv4GroupInterface::AddressSet::Iterator it
|
IPv4GroupInterface::AddressSet::Iterator addressIterator
|
||||||
= state->Sources().GetIterator();
|
= state->Sources().GetIterator();
|
||||||
while (it.HasNext()) {
|
while (addressIterator.HasNext()) {
|
||||||
kprintf("%s%s", count > 0 ? ", " : "", print_address(&it.Next(),
|
kprintf("%s%s", count > 0 ? ", " : "",
|
||||||
|
print_address(&addressIterator.Next(),
|
||||||
addressBuffer, sizeof(addressBuffer)));
|
addressBuffer, sizeof(addressBuffer)));
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user