Fix potential issue in enumeration of LLDP reported system capabilities supported by the remote system due to the 'lldpRemSysCapSupported' leaf name being defined in multiple MIBs

This commit is contained in:
Eric A. Miller
2018-05-06 10:51:19 -04:00
parent 0ab688964f
commit 4681004b52
3 changed files with 13 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
Version 3.60 (2018-05-05) Version 3.60 (2018-05-06)
[ENHANCEMENTS] [ENHANCEMENTS]
@@ -6,7 +6,11 @@ Version 3.60 (2018-05-05)
[BUG FIXES] [BUG FIXES]
* #140 LLDP fixes - treat remote port type of 'local' as an interface name * #140 LLDP fixes - treat remote port type of 'local' as an interface name if
the remote port id doesn't look like an index
* Fix potential issue in enumeration of LLDP reported system capabilities
supported by the remote system due to the 'lldpRemSysCapSupported' leaf
name being defined in multiple MIBs
Version 3.59 (2018-05-01) Version 3.59 (2018-05-01)

View File

@@ -333,7 +333,8 @@ sub lldp_cap {
# Encoded as BITS which Perl Net-SNMP implementation doesn't seem to # Encoded as BITS which Perl Net-SNMP implementation doesn't seem to
# be able to enumerate for us, so we have to get it from the MIB # be able to enumerate for us, so we have to get it from the MIB
# and enumerate ourselves # and enumerate ourselves
my $oid = SNMP::translateObj( 'lldpRemSysCapEnabled', 0, 1 ) || ''; my $oid
= SNMP::translateObj( 'LLDP-MIB::lldpRemSysCapEnabled', 0, 1 ) || '';
my $enums = ( my $enums = (
( ref {} eq ref $SNMP::MIB{$oid}{'enums'} ) ( ref {} eq ref $SNMP::MIB{$oid}{'enums'} )
? $SNMP::MIB{$oid}{'enums'} ? $SNMP::MIB{$oid}{'enums'}

View File

@@ -376,9 +376,11 @@ sub lldp_cap : Tests(4) {
can_ok($test->{info}, 'lldp_cap'); can_ok($test->{info}, 'lldp_cap');
my $expected = {'0.6.1' => ['bridge', 'router']}; my $expected = ['bridge', 'router'];
cmp_deeply($test->{info}->lldp_cap(), $expected, my $caps = $test->{info}->lldp_cap();
cmp_set($caps->{'0.6.1'}, $expected,
q(Caps emumerated correctly)); q(Caps emumerated correctly));
$test->{info}{store}{lldp_rem_cap_spt} = {'0.6.1' => pack("H*", '0000')}; $test->{info}{store}{lldp_rem_cap_spt} = {'0.6.1' => pack("H*", '0000')};