Harden SNMP request even more

This commit is contained in:
CPbN 2019-01-10 23:12:28 +01:00
parent c50921f82d
commit 53b52196ad

View File

@ -326,7 +326,7 @@ sub get_leef {
# Some equipments gives a partial response and no error. # Some equipments gives a partial response and no error.
# We look the last value if it's empty or not # We look the last value if it's empty or not
if (scalar(@$vb) && (scalar(@{@$vb[-1]}) < 3)) { if ((scalar(@$vb) != scalar(@{$entry})) || (scalar(@{@$vb[-1]}) < 3)) {
next if ($self->{snmp_autoreduce} == 1 && $self->autoreduce_leef(current => $entry) == 0); next if ($self->{snmp_autoreduce} == 1 && $self->autoreduce_leef(current => $entry) == 0);
if ($dont_quit == 0) { if ($dont_quit == 0) {
$self->{output}->add_option_msg(short_msg => "SNMP partial response. Please try --snmp-autoreduce option"); $self->{output}->add_option_msg(short_msg => "SNMP partial response. Please try --snmp-autoreduce option");