snmp-ups: quiesce "unhandled ASN 0x80 received from ..." when we fall back to using the numeric value from last OID section#3337
Open
jimklimov wants to merge 4 commits intonetworkupstools:masterfrom
Open
Conversation
|
✅ Build nut 2.8.4.4286-master completed (commit 0feb1da11b by @jimklimov) |
…workupstools#3095] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…rom ..." when we fall back to using the numeric value from last OID section [networkupstools#1358] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… also (especially) when snmp_synch_response() failed [networkupstools#1358] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…t_snmp_get()=>nut_snmp_walk() when we fall back to using the numeric value from last OID section [networkupstools#1358] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #1358
Per analysis in the ticket (thanks @smarsching), we sometime get OIDs to something that represents a constant, that should not really be resolved. When we recurse from
nut_snmp_get_int(for anASN_OBJECT_IDPDU type) we first loudlyupslogxan error in thedefaultcase (the0x80seems to beASN_CONTEXT, with no more context to indicate that this specific query went to a constant... or should the lack of other bits mean exactly this?) and then fall back to returning the last section of the OID as the desired number.With this PR, the original
nut_snmp_get_int()method body became the implementation ofdo_nut_snmp_get_int()with an added option to log thedefaultcase loudly (upslogx()) or quietly (upsdebugx()), and thenut_snmp_get_int()signature called by others is a shortcut to call this implementation with loud debugging. Recursing into itself forASN_OBJECT_IDis done in quiet mode.This way, I hope, we still log OIDs that are out of place in e.g. mapping tables, but would not make infinite system log noise for returned references like these.