fix bug in vlan filtered netmap, duplicate nodes

This commit is contained in:
Oliver Gorwits
2020-01-22 21:19:04 +00:00
parent abf415a1ca
commit ee86e62ac7
2 changed files with 12 additions and 1 deletions

View File

@@ -216,7 +216,10 @@ ajax '/ajax/data/device/netmap' => require_login sub {
);
}
my %seen_node = ();
DEVICE: while (my $device = $devices->next) {
next if $seen_node{$device->ip};
# if in neighbors mode then use %ok_dev to filter
next DEVICE if ($device->ip ne $qdev->ip)
and ($mapshow eq 'neighbors')
@@ -269,6 +272,8 @@ ajax '/ajax/data/device/netmap' => require_login sub {
}
push @{$data{'nodes'}}, $node;
++$seen_node{$device->ip};
$metadata{'centernode'} = $device->ip
if $qdev and $qdev->in_storage and $device->ip eq $qdev->ip;
}