clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
216 stars 71 forks source link

Remove null terminator for SNMP octet string #493

Closed mico-micic closed 7 months ago

mico-micic commented 7 months ago

In the SNMP protocol all tranfered values (bindings) have a defined length. Therefore the octet string does not need a null terminator. If there is one, it is transfered as control character and may confuse SNMP agents like snmp4j. (snmpget shows a "." character at the end what ist not correct.)

Check the result without and with this fix ("." at the end of "Some string value")

--> Without this fix:
$ snmpget -v2c -c private localhost SIMPLE-MIB::testAlphaOneConfstring.0
SIMPLE-MIB::testAlphaOneConfstring.0 = STRING: Some string value.

--> With this fix:
$ snmpget -v2c -c private localhost SIMPLE-MIB::testAlphaOneConfstring.0
SIMPLE-MIB::testAlphaOneConfstring.0 = STRING: Some string value
olofhagsand commented 7 months ago

Looks good to me