Arduino_SNMP icon indicating copy to clipboard operation
Arduino_SNMP copied to clipboard

Issue when GoSNMP library uses the default MaxRepetitions=50

Open Assar-Westman opened this issue 2 years ago • 1 comments

Hi I had an issue with Arduino locking up when using the GoSNMP library doing a bulkwalk. After some testing it was found that the default MaxRepititions=50 in the GoSNMP library made the Arduino to crash. I did a simple patch in the SNMPParser.cpp

@@ -63,10 +63,6 @@
                 pass = false;
                 globalError = GEN_ERR;
             } else {
-                // These three lines are needed to make big bulkwalk possible, without memory will be thrashed and the Arduino will stop working
-                if ( request.errorIndex.maxRepititions > 10 ){
-                    request.errorIndex.maxRepititions = 10;
-                }
                 pass = handleGetBulkRequestPDU(callbacks, request.varbindList, outResponseList, request.errorStatus.nonRepeaters, request.errorIndex.maxRepititions);
                 handleStatus = SNMP_GETBULK_OCCURRED;
             }
@@ -112,4 +108,4 @@
     }

     return handleStatus;
-}
+}

For me it seems to fix the crashing issue even when MaxRepititions=50 Best regards Assar W.

Assar-Westman avatar Sep 01 '22 16:09 Assar-Westman

Hey there, could you make a PR with this change?

0neblock avatar Jan 19 '23 00:01 0neblock