- 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.
This commit is contained in:
31
Info.pm
31
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");
|
||||
|
||||
Reference in New Issue
Block a user