Skip to content

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
jimklimov:issue-1358
Open

snmp-ups: quiesce "unhandled ASN 0x80 received from ..." when we fall back to using the numeric value from last OID section#3337
jimklimov wants to merge 4 commits intonetworkupstools:masterfrom
jimklimov:issue-1358

Conversation

@jimklimov
Copy link
Member

@jimklimov jimklimov commented Mar 3, 2026

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 an ASN_OBJECT_ID PDU type) we first loudly upslogx an error in the default case (the 0x80 seems to be ASN_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 of do_nut_snmp_get_int() with an added option to log the default case loudly (upslogx()) or quietly (upsdebugx()), and the nut_snmp_get_int() signature called by others is a shortcut to call this implementation with loud debugging. Recursing into itself for ASN_OBJECT_ID is 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.

@AppVeyorBot
Copy link

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in snmp-ups.c causes bogus “unhandled ASN0x80” messages to be logged

2 participants