From 3b8b70f7609e747baa6d604a917d487a1b1844b2 Mon Sep 17 00:00:00 2001 From: Eric Miller <> Date: Mon, 21 Jul 2008 03:24:16 +0000 Subject: [PATCH] - Move _load_attr() loopdetect code below other end of table checks. - Add another check for SNMPv1 - noSuchName where we've already seen the iid and iid is not null but the return value is null. Don't report a loop, just exit the table. --- Info.pm | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Info.pm b/Info.pm index 48b5d7b6..a3cb443f 100644 --- a/Info.pm +++ b/Info.pm @@ -3327,18 +3327,6 @@ sub _load_attr { next; } - if ($loopdetect) { - - # Check to see if we've already seen this IID (looping) - if ( defined $seen{$iid} and $seen{$iid} ) { - $self->error_throw("Looping on: $attr iid:$iid. "); - last; - } - else { - $seen{$iid}++; - } - } - # Check to make sure we are still in partial land if ( defined $partial and $iid !~ /^$partial$/ @@ -3360,6 +3348,25 @@ sub _load_attr { last; } + # Another check for SNMPv1 - noSuchName return may results in an $iid + # we've already seen and $val an empty string. If we don't catch + # this here we erronously report a loop below. + if ( defined $seen{$iid} and $seen{$iid} and $val eq '' ) { + last; + } + + if ($loopdetect) { + + # Check to see if we've already seen this IID (looping) + if ( defined $seen{$iid} and $seen{$iid} ) { + $self->error_throw("Looping on: $attr iid:$iid. "); + last; + } + else { + $seen{$iid}++; + } + } + if ( $val eq 'NOSUCHOBJECT' ) { $self->error_throw( "SNMP::Info::_load_attr: $attr : NOSUCHOBJECT");