fix snmp lib start/end checkup function (#1292)

This commit is contained in:
Colin Gagnaire 2018-12-26 12:05:40 +01:00 committed by GitHub
parent 1b6c8ed46b
commit a40ba56d5a
1 changed files with 6 additions and 4 deletions

View File

@ -410,7 +410,7 @@ sub get_multiple_table {
my $base = $bases[$pos % $current_oids]; my $base = $bases[$pos % $current_oids];
if ($complete_oid !~ /^$base\./ || if ($complete_oid !~ /^$base\./ ||
(defined($working_oids->{ $bases[$pos % $current_oids] }->{end}) && (defined($working_oids->{ $bases[$pos % $current_oids] }->{end}) &&
$self->check_oid_up($complete_oid, $working_oids->{ $bases[$pos % $current_oids] }->{end}) )) { $self->check_oid_up(current => $complete_oid, end => $working_oids->{ $bases[$pos % $current_oids] }->{end}))) {
delete $working_oids->{ $bases[$pos % $current_oids] }; delete $working_oids->{ $bases[$pos % $current_oids] };
next; next;
} }
@ -540,7 +540,7 @@ sub get_table {
# Not in same table # Not in same table
my $complete_oid = ${$entry}[0] . "." . ${$entry}[1]; my $complete_oid = ${$entry}[0] . "." . ${$entry}[1];
if ($complete_oid !~ /^$main_indice\./ || if ($complete_oid !~ /^$main_indice\./ ||
(defined($options{end}) && $self->check_oid_up($complete_oid, $options{end}) )) { (defined($options{end}) && $self->check_oid_up(current => $complete_oid, end => $options{end}))) {
$leave = 0; $leave = 0;
last; last;
} }
@ -615,8 +615,10 @@ sub clean_oid {
} }
sub check_oid_up { sub check_oid_up {
my ($self) = @_; my ($self, %options) = @_;
my ($current_oid, $end_oid) = @_;
my $current_oid = $options{current};
my $end_oid = $options{end};
my @current_oid_splitted = split /\./, $current_oid; my @current_oid_splitted = split /\./, $current_oid;
my @end_oid_splitted = split /\./, $end_oid; my @end_oid_splitted = split /\./, $end_oid;