diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-12-17 14:25:09 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-12-17 14:25:09 +0100 |
commit | e81dfd5f8a29bc10037429e55b0beeec66114927 (patch) | |
tree | e56393124bc1d2775d97177b3778b403c00ddec7 | |
parent | 91b30573c997f08d3e8ba8c471248a4434d59564 (diff) | |
download | pysnmp-git-e81dfd5f8a29bc10037429e55b0beeec66114927.tar.gz |
preserve SNMPv1 error-status when proxying to SNMPv2c
-rw-r--r-- | CHANGES.txt | 3 | ||||
-rw-r--r-- | pysnmp/proto/proxy/rfc2576.py | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 8258e5ee..f33864cd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,9 @@ Revision 4.4.3, released 2017-12-XX - Added missing SHA2 support for Blumenthal key localization - Fixed named bits handling at rfc1902.Bits - Fixed missing SmiError exception class at pysnmp.proto.rfc1155 +- Fixed SNMP v1->v2c PDU proxy -- error-status & error-index fields + from v1 PDU get copied over to v2c PDU in addition to the exception + sentinels being set Revision 4.4.2, released 2017-11-11 ----------------------------------- diff --git a/pysnmp/proto/proxy/rfc2576.py b/pysnmp/proto/proxy/rfc2576.py index 01d909c4..3ac07acb 100644 --- a/pysnmp/proto/proxy/rfc2576.py +++ b/pysnmp/proto/proxy/rfc2576.py @@ -151,14 +151,12 @@ def v1ToV2(v1Pdu, origV2Pdu=None, snmpTrapCommunity=''): v2VarBinds = [(o, rfc1905.endOfMibView) for o, v in v2VarBinds] else: v2VarBinds = [(o, rfc1905.noSuchObject) for o, v in v2VarBinds] - v2c.apiPDU.setErrorStatus(v2Pdu, 0) - v2c.apiPDU.setErrorIndex(v2Pdu, 0) - else: - # partial one-to-one mapping - 4.2.1 - v2c.apiPDU.setErrorStatus(v2Pdu, errorStatus) - v2c.apiPDU.setErrorIndex(v2Pdu, errorIndex) - # 4.1.2.1 --> no-op + # partial one-to-one mapping - 4.2.1 + v2c.apiPDU.setErrorStatus(v2Pdu, errorStatus) + v2c.apiPDU.setErrorIndex(v2Pdu, errorIndex) + + # 4.1.2.1 --> no-op elif pduType in rfc3411.confirmedClassPDUs: v2c.apiPDU.setErrorStatus(v2Pdu, 0) |