From 0e572db8322eca2f36089a2c637ace35e2cb2de5 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Sun, 15 Dec 2013 08:34:27 -0500 Subject: [PATCH] lldp_platform() now tries to return something useful from either lldp_rem_sysdesc() or lldp_rem_sysname(). --- Info/LLDP.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Info/LLDP.pm b/Info/LLDP.pm index cb90c43c..c38c5c4e 100644 --- a/Info/LLDP.pm +++ b/Info/LLDP.pm @@ -231,7 +231,15 @@ sub lldp_platform { my $lldp = shift; my $partial = shift; - return $lldp->lldp_rem_sysdesc($partial); + my $rid = $lldp->lldp_rem_id($partial) || {}; + my $desc = $lldp->lldp_rem_sysdesc($partial) || {}; + my $name = $lldp->lldp_rem_sysname($partial) || {}; + + my %lldp_platform; + foreach my $key (keys %$rid) { + $lldp_platform{$key} = $desc->{$key} || $name->{$key}; + } + return \%lldp_platform; } #sub root_ip { @@ -449,7 +457,8 @@ Returns remote port ID =item $lldp->lldp_platform() -Alias for C. +Tries to return something useful from C or +C. =back