IEEE802dot3ad portlist is indexed with a dot1dBasePort, cross reference with dot1dBasePortIfIndex
This commit is contained in:
7
Changes
7
Changes
@@ -1,3 +1,10 @@
|
|||||||
|
Version 3.57
|
||||||
|
|
||||||
|
[BUG FIXES]
|
||||||
|
|
||||||
|
* IEEE802dot3ad portlist is indexed with a dot1dBasePort, cross reference
|
||||||
|
with dot1dBasePortIfIndex
|
||||||
|
|
||||||
Version 3.56 (2018-04-22)
|
Version 3.56 (2018-04-22)
|
||||||
|
|
||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ sub agg_ports_lag {
|
|||||||
my $dev = shift;
|
my $dev = shift;
|
||||||
|
|
||||||
# TODO: implement partial
|
# TODO: implement partial
|
||||||
my $ports = $dev->ad_lag_ports;
|
my $ports = $dev->ad_lag_ports();
|
||||||
|
my $index = $dev->bp_index() || {};
|
||||||
|
|
||||||
return {} unless ref {} eq ref $ports and scalar keys %$ports;
|
return {} unless ref {} eq ref $ports and scalar keys %$ports;
|
||||||
|
|
||||||
@@ -73,9 +74,18 @@ sub agg_ports_lag {
|
|||||||
my $idx = $m;
|
my $idx = $m;
|
||||||
my $portlist = $ports->{$m};
|
my $portlist = $ports->{$m};
|
||||||
next unless $portlist;
|
next unless $portlist;
|
||||||
|
|
||||||
|
# While dot3adAggTable is indexed by ifIndex, the portlist is indexed
|
||||||
|
# with a dot1dBasePort, so we need to use dot1dBasePortIfIndex to map to
|
||||||
|
# the ifIndex. If we don't have dot1dBasePortIfIndex assume
|
||||||
|
# dot1dBasePort = ifIndex
|
||||||
for ( my $i = 0; $i <= scalar(@$portlist); $i++ ) {
|
for ( my $i = 0; $i <= scalar(@$portlist); $i++ ) {
|
||||||
$ret->{$i+1} = $idx if ( @$portlist[$i] );
|
my $ifindex = $i+1;
|
||||||
}
|
if ( exists($index->{$i+1}) and defined($index->{$i+1}) ) {
|
||||||
|
$ifindex = $index->{$i+1};
|
||||||
|
}
|
||||||
|
$ret->{$ifindex} = $idx if ( @$portlist[$i] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user