fixed non-translated PDU version retries at CommandGenerator

pull/102/head
Ilya Etingof 2017-10-18 12:14:53 +02:00
parent 05df34cc3a
commit fff063aba9
2 changed files with 14 additions and 1 deletions

View File

@ -13,6 +13,9 @@ Revision 4.4.1, released 2017-10-XX
- Fixed NetworkAddress object handling in SNMP table indices
- Fixed MIB lookup by module:object.indices MIB object with
InetAddressIPv{4,6} objects being in the index
- Fixed non-translated PDU being retries at CommandGenerator what
leads to wrong PDU version being sent and even a crash on
incompatible PDU/SNMP message combination
Revision 4.3.10, released 2017-10-06
------------------------------------

View File

@ -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))