Attempt to fill in missing bp_index mappings on wired Aruba switches.
This commit is contained in:
@@ -628,22 +628,36 @@ sub bp_index {
|
||||
my $aruba = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $i_index = $aruba->orig_i_index($partial) || {};
|
||||
my $i_index = $aruba->ifExtPortIfIndex($partial) || {};
|
||||
my $essid_ssid = $aruba->aruba_ap_bssid_ssid($partial) || {};
|
||||
|
||||
# Collect standard bp_index first
|
||||
my $wired_bp_index = $aruba->SUPER::bp_index($partial) || {};
|
||||
my %bp_index = %$wired_bp_index;
|
||||
my %bp_index;
|
||||
my %offset;
|
||||
|
||||
foreach my $iid ( keys %$wired_bp_index ) {
|
||||
my $index = $wired_bp_index->{$iid};
|
||||
my $delta = $iid - $index;
|
||||
|
||||
$offset{$delta}++;
|
||||
$bp_index{$iid} = $index;
|
||||
}
|
||||
|
||||
# If the offset between dot1dBasePortIfIndex and ifIndex is consistent
|
||||
# add potentially missing mappings
|
||||
if ( keys %offset == 1 ) {
|
||||
foreach my $iid ( keys %$i_index ) {
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
# Only augment bp_index, don't overwrite any existing mappings
|
||||
my $iid = (keys %offset)[0] + $index;
|
||||
next if exists $bp_index{$iid};
|
||||
|
||||
$bp_index{$iid} = $index;
|
||||
}
|
||||
}
|
||||
|
||||
# Get Attached APs as Interfaces
|
||||
foreach my $oid ( keys %$essid_ssid ) {
|
||||
|
||||
Reference in New Issue
Block a user