diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-10-18 12:14:53 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-10-18 12:14:53 +0200 |
commit | fff063aba993cab2ebe26cc416a4d2df3bc43a28 (patch) | |
tree | 266f1b7d85e178eeac0814b20567da047de809a5 /pysnmp/entity | |
parent | 05df34cc3ae0a04dbd1854f633e58b6180157d59 (diff) | |
download | pysnmp-git-fff063aba993cab2ebe26cc416a4d2df3bc43a28.tar.gz |
fixed non-translated PDU version retries at CommandGenerator
Diffstat (limited to 'pysnmp/entity')
-rw-r--r-- | pysnmp/entity/rfc3413/cmdgen.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pysnmp/entity/rfc3413/cmdgen.py b/pysnmp/entity/rfc3413/cmdgen.py index d4f108a1..d4c9d92d 100644 --- a/pysnmp/entity/rfc3413/cmdgen.py +++ b/pysnmp/entity/rfc3413/cmdgen.py @@ -70,6 +70,7 @@ class CommandGenerator(object): debug.logger & debug.flagApp and debug.logger( 'processResponsePdu: sendPduHandle %s, statusInformation %s' % (sendPduHandle, statusInformation)) errorIndication = statusInformation['errorIndication'] + # SNMP engine discovery will take extra retries, allow that if (errorIndication in (errind.notInTimeWindow, errind.unknownEngineID) and @@ -81,12 +82,21 @@ class CommandGenerator(object): cbFun(snmpEngine, origSendRequestHandle, statusInformation['errorIndication'], None, cbCtx) return + + # User-side API assumes SMIv2 + if origMessageProcessingModel == 0: + reqPDU = rfc2576.v2ToV1(origPdu) + pduVersion = 0 + else: + reqPDU = origPdu + pduVersion = 1 + try: sendPduHandle = snmpEngine.msgAndPduDsp.sendPdu( snmpEngine, origTransportDomain, origTransportAddress, origMessageProcessingModel, origSecurityModel, origSecurityName, origSecurityLevel, origContextEngineId, - origContextName, origPduVersion, origPdu, + origContextName, pduVersion, reqPDU, True, origTimeout, self.processResponsePdu, (origSendRequestHandle, cbFun, cbCtx)) |