diff --git a/lib/SNMP/Info/Layer3/Juniper.pm b/lib/SNMP/Info/Layer3/Juniper.pm index a52d7e24..8949fb4e 100644 --- a/lib/SNMP/Info/Layer3/Juniper.pm +++ b/lib/SNMP/Info/Layer3/Juniper.pm @@ -328,12 +328,12 @@ sub i_vlan_membership { foreach my $vlan ( keys %$v_ports ) { my @bp_indexes = split /,/, $v_ports->{$vlan}; foreach my $idx (@bp_indexes) { - if (!exists $bp_index->{$_}) { + if (!exists $bp_index->{$idx}) { print " VLAN $vlan has no bp_index mapping. Skipping.\n" if $DEBUG; next; } - push @{ $res->{ $bp_index->{$_} } }, $vlan for @bp_indexes; + push @{ $res->{ $bp_index->{$idx} } }, $vlan; } } return $res; @@ -361,12 +361,12 @@ sub i_vlan_membership_untagged { foreach my $vlan ( keys %$v_ports ) { my @bp_indexes = split /,/, $v_ports->{$vlan}; foreach my $idx (@bp_indexes) { - if (!exists $bp_index->{$_}) { + if (!exists $bp_index->{$idx}) { print " untagged VLAN $vlan has no bp_index mapping. Skipping.\n" if $DEBUG; next; } - push @{ $res->{ $bp_index->{$_} } }, $vlan for @bp_indexes; + push @{ $res->{ $bp_index->{$idx} } }, $vlan; } } return $res;