Skip to content
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

Remove GoSNMP.NonRepeaters. #466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dplepage-dd
Copy link

There's a value .NonRepeaters defined in gosnmp.go. The comment on this value is wrong - there is no max-repeaters value defined by that RFC, only max-repetitions, which is set by .MaxRepetitions. In fact, what this attribute is setting is the non-repeaters attribute, which is NOT something that makes sense as a global setting - it indicates how many of the oids provided in a GETBULK request should only have one value fetched, instead of bulk-fetching max-repetitions OIDs starting at that point.

In the only place this attribute is used, as part of walk.go, there is exactly one OID being passed in, and the whole point of using GetBulk is that we want to fetch more than one value, so in this call non-repeaters should always be set to 0; it should not be configurable. Setting it to anything greater than zero simply means that GetBulk will now only fetch one value for that OID; if you want that behavior, you should be using .Walk instead of .BulkWalk.

So as a parameter, its sole behavior is to make .BulkWalk* behave unexpectedly badly; it is not something that should exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant