-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix(inputs.snmp_trap): Copy GoSNMP global defaults to prevent side-effects #13542
fix(inputs.snmp_trap): Copy GoSNMP global defaults to prevent side-effects #13542
Conversation
When multiple listeners are used with different auth configs - they are all using the same pointer to global default values and scribbling all over it. Causes the last defined auth settings to succeed. Yuk
This reverts commit b270910.
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix @mark-chandler! Thanks for your contribution!
No worries. Always nice to give back to a great project. |
Required for all PRs
resolves #13414
Setting up the SNMP parameters using gosnmp.Default seems to be using the same pointer for every instance.
Replace this with code that creates a separate variable each time copied from gosnmp.Default, then passes the pointer to that variable into the listener.Params.
Bump version of gosnmp package to a more recent commit.
Add some extra logging for gosnmp.