[#54] Possible bad values returned for lldp_port with some HP gear

This commit is contained in:
Eric A. Miller
2014-07-01 23:06:25 -04:00
parent 08e049eb31
commit 8dd32c0dd7
2 changed files with 3 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ version 3.18
have overridden layers.
* [#58] Fix inheritance in L3::FWSM and L3::CiscoASA
* [#71] Don't try to match on a false port description in lldp_if
* [#54] Posible bad values returned for cdp_id with some HP
* [#54] Possible bad values returned for cdp_id and lldp_port with some HP
gear (Joel Leonhardt)
version 3.17 (2014-06-23)

View File

@@ -170,6 +170,7 @@ sub lldp_port {
my $pdesc = $lldp->lldp_rem_desc($partial) || {};
my $pid = $lldp->lldp_rem_pid($partial) || {};
my $ptype = $lldp->lldp_rem_pid_type($partial) || {};
my $vendor = $lldp->vendor();
my %lldp_port;
foreach my $key ( sort keys %$pid ) {
@@ -194,7 +195,7 @@ sub lldp_port {
# Avaya/Nortel lldpRemPortDesc doesn't match ifDescr, but we can still
# figure out slot.port based upon lldpRemPortDesc
if ( $port =~ /^(Unit\s+(\d+)\s+)?Port\s+(\d+)$/ ) {
if ( $vendor eq 'avaya' && $port =~ /^(Unit\s+(\d+)\s+)?Port\s+(\d+)$/ ) {
$port = defined $1 ? "$2.$3" : "$3";
}