This repository was archived by the owner on Mar 22, 2023. It is now read-only.
File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -978,10 +978,10 @@ sub my_snmp_handler {
978
978
}
979
979
980
980
if ($mode == MODE_GETNEXT) {
981
- if ($oid < $lowestOid ) {
981
+ if (NetSNMP::OID::compare( $oid , $lowestOid ) < 0 ) {
982
982
set_value($request , $lowestOid , $request_info );
983
983
}
984
- elsif ($oid < $highestOid ) # request is somewhere in our range, so return first one after it
984
+ elsif (NetSNMP::OID::compare( $oid , $highestOid ) <= 0 ) # request is somewhere in our range, so return first one after it
985
985
{
986
986
my $lasti = 0;
987
987
my $i = 0;
@@ -991,10 +991,14 @@ sub my_snmp_handler {
991
991
do {
992
992
$oidToUse = $ks [$i ];
993
993
$i ++;
994
- } while (NetSNMP::OID::compare($oid , $oidToUse ) > -1 and $i <= scalar @ks );
994
+ } while (NetSNMP::OID::compare($oid , $oidToUse ) > -1 and $i < scalar @ks );
995
995
996
996
# got one to return
997
997
if (defined $oidToUse ) {
998
+ if (NetSNMP::OID::compare($oid , $oidToUse ) == 0) {
999
+ dolog(LOG_DEBUG, " GETNEXT $oid == $oidToUse , no next, returning nothing" ); if ($opt {verbose })
1000
+ next ;
1001
+ }
998
1002
dolog(LOG_DEBUG, " Next oid to $oid is $oidToUse " ) if ($opt {verbose });
999
1003
while (!set_value($request , $oidToUse , $request_info )) {
1000
1004
# got not value, we need to get the next oid
You can’t perform that action at this time.
0 commit comments