diff --git a/Changes b/Changes index 098606bc..57c852c5 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,10 @@ version 3.38 () * Layer2::Airespace several newer 802.11 data rates added + [BUG FIXES] + + * #232 Improve generic Info::Layer3 serial number detection + version 3.37 (2017-07-11) [ENHANCEMENTS] diff --git a/lib/SNMP/Info/Layer3.pm b/lib/SNMP/Info/Layer3.pm index d7b4d05a..3f3ccae0 100644 --- a/lib/SNMP/Info/Layer3.pm +++ b/lib/SNMP/Info/Layer3.pm @@ -196,10 +196,13 @@ sub serial { my $serial1 = $l3->serial1(); my $e_parent = $l3->e_parent() || {}; + my $e_class = $l3->e_class() || {}; foreach my $iid ( keys %$e_parent ) { my $parent = $e_parent->{$iid}; - if ( $parent eq '0' ) { + my $class = $e_class->{$iid} || ''; + # Only consider serial numbers for entries without a parent, or if they are of type "chassis" + if ( $parent eq '0' or $class eq 'chassis') { my $serial = $l3->e_serial($iid); if ( $serial && $serial->{$iid} ) { return $serial->{$iid};