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");