From 5af11cb6122dcd7abe9e6660084ea831abe77364 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 4 Nov 2023 11:55:40 +0000 Subject: [PATCH] #506 fix uninitialised error for hash keys --- lib/SNMP/Info/Aggregate.pm | 2 ++ lib/SNMP/Info/CiscoAgg.pm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/SNMP/Info/Aggregate.pm b/lib/SNMP/Info/Aggregate.pm index 0aaf0c7b..e5096f99 100644 --- a/lib/SNMP/Info/Aggregate.pm +++ b/lib/SNMP/Info/Aggregate.pm @@ -63,6 +63,8 @@ sub agg_ports_ifstack { foreach my $idx ( keys %$ifStack ) { my ( $higher, $lower ) = split /\./, $idx; next if ( $higher == 0 or $lower == 0 ); + next unless exists $ifType->{ $higher } and defined $ifType->{ $higher }; + if ( $ifType->{ $higher } eq 'ieee8023adLag' or $ifType->{ $higher } eq 'propMultiplexor' ) { $ret->{ $lower } = $higher; diff --git a/lib/SNMP/Info/CiscoAgg.pm b/lib/SNMP/Info/CiscoAgg.pm index c39518de..0538f01e 100644 --- a/lib/SNMP/Info/CiscoAgg.pm +++ b/lib/SNMP/Info/CiscoAgg.pm @@ -153,6 +153,8 @@ sub agg_ports_propvirtual { foreach my $idx ( keys %$ifStack ) { my ( $higher, $lower ) = split /\./, $idx; next if ( $higher == 0 or $lower == 0 ); + next unless exists $ifType->{ $higher } and defined $ifType->{ $higher }; + if ( $ifType->{ $higher } eq 'propVirtual' ) { # lower needs also to be configured in pagpEthcOperationMode