Fix in i_vlan() and i_vlan_membership() for newer code

This commit is contained in:
Eric Miller
2006-11-03 22:17:33 +00:00
parent 1be0292e78
commit 1ac5cdd110

View File

@@ -124,6 +124,7 @@ sub i_vlan {
my $port_vlan = $vtp->vtp_trunk_native($partial) || {}; my $port_vlan = $vtp->vtp_trunk_native($partial) || {};
my $i_vlan = $vtp->i_vlan2($partial) || {}; my $i_vlan = $vtp->i_vlan2($partial) || {};
my $trunk_dyn_stat = $vtp->vtp_trunk_dyn_stat($partial) || {};
my %i_vlans; my %i_vlans;
# Get access ports # Get access ports
@@ -138,9 +139,11 @@ sub i_vlan {
foreach my $port (keys %$port_vlan) { foreach my $port (keys %$port_vlan) {
my $vlan = $port_vlan->{$port}; my $vlan = $port_vlan->{$port};
next unless defined $vlan; next unless defined $vlan;
my $stat = $trunk_dyn_stat->{$port};
if ( defined $stat and $stat =~ /^trunking/ ) {
$i_vlans{$port} = $vlan; $i_vlans{$port} = $vlan;
} }
}
# Check in CISCO-VLAN-IFTABLE-RELATION-MIB # Check in CISCO-VLAN-IFTABLE-RELATION-MIB
# Is this only for Aironet??? If so, it needs # Is this only for Aironet??? If so, it needs
@@ -169,6 +172,7 @@ sub i_vlan_membership {
my $ports_vlans = $vtp->vtp_trunk_vlans($partial) || {}; my $ports_vlans = $vtp->vtp_trunk_vlans($partial) || {};
my $vtp_vlans = $vtp->v_state(); my $vtp_vlans = $vtp->v_state();
my $i_vlan = $vtp->i_vlan2($partial) || {}; my $i_vlan = $vtp->i_vlan2($partial) || {};
my $trunk_dyn_stat = $vtp->vtp_trunk_dyn_stat($partial) || {};
my $i_vlan_membership = {}; my $i_vlan_membership = {};
@@ -176,9 +180,11 @@ sub i_vlan_membership {
foreach my $port (keys %$i_vlan) { foreach my $port (keys %$i_vlan) {
my $vlan = $i_vlan->{$port}; my $vlan = $i_vlan->{$port};
next unless defined $vlan; next unless defined $vlan;
my $stat = $trunk_dyn_stat->{$port};
unless ( defined $stat and $stat =~ /^trunking/ ) {
push(@{$i_vlan_membership->{$port}}, $vlan); push(@{$i_vlan_membership->{$port}}, $vlan);
} }
}
# Get trunk ports # Get trunk ports
foreach my $port (keys %$ports_vlans) { foreach my $port (keys %$ports_vlans) {