#378 fix several uninitialized vars

This commit is contained in:
Oliver Gorwits
2021-10-07 10:19:28 +01:00
parent d535cea7db
commit a0cd7c57e2
3 changed files with 5 additions and 5 deletions

View File

@@ -349,7 +349,7 @@ sub ipv6_addr_prefixlength {
# Remove interface specific part from vrf interfaces
if ($row =~ /^((\d+\.){17}\d+)/) { $row = $1 }
# Remove the OID part from the value
my $val = $ipv6_addr_prefix->{$row};
my $val = $ipv6_addr_prefix->{$row} || '';
if ( $val =~ /^.+?((?:\d+\.){19}(\d+))$/ ) {
$val = $2;
$return->{$row} = $val;

View File

@@ -105,8 +105,8 @@ sub model {
sub vendor {
my $l2 = shift;
my $model = $l2->model();
my $descr = $l2->description();
my $model = $l2->model() || '';
my $descr = $l2->description() || '';
if ( $model =~ /hp/i or $descr =~ /\bhp\b/i ) {
return 'hp';

View File

@@ -357,8 +357,8 @@ sub interfaces {
sub vendor {
my $l3 = shift;
my $descr = $l3->description();
my $id = $l3->id();
my $descr = $l3->description() || '';
my $id = $l3->id() || '';
# .1.3.6.1.4.1.9.1 is the CISCO-PRODUCTS-MIB
# .1.3.6.1.4.1.9.9.368.4 is an old tree that Cisco CSSs were numbered from