-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BulkWalk (not Walk) hangs permanently if malformed OID is anywhere in tree #408
Comments
This particular malformed OID value ( |
Hello, I'm getting the same problem on my Cisco Nexus device using latest version of "gosnmp", but my OID doesn't seem to be malformed. BulkWalk function hangs on this OID with non-complicated value: Walk function runs without problems but it's much slower and it's not an option for me. Any plans about fixing this soon? Thanks |
I found solution by comparing pcap files from this library and snmpbulkwalk. I modified value of defaultMaxRepetitions in gosnmp.go 50->10 and suddenly BulkWalkAll works on all my problematic devices I had. Fix proposal: |
You don't need to adjust the default in the code, you can set it via |
BulkWalk
, but notWalk
, hangs permanently if a malformed OID like the following is encountered (NET-SNMP v5.7.2
bulkwalk output shown below):The middle OID overruns the 1 KiB buffer it has apparently been allocated, and is therefore probably not null-terminated and also has an unclosed
'
. I included the surrounding OIDs just in case they affect the result.go.mod
:Using the
walkexample
code with some extra debug:To reproduce
go run . myhost .1.3.6.1.4.1.2021.100
Expected behavior
All the OIDs and their values should be printed, OR an error should be returned.
Observed behavior
No OIDs nor values are printed, and the program hangs permanently.
The text was updated successfully, but these errors were encountered: