summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2011-02-11 21:11:42 +0000
committerelie <elie>2011-02-11 21:11:42 +0000
commit1438ad8dd32f378791d064b94f4d891cafb9ca55 (patch)
tree6af90b3b3cd9233fef6e03bc43e14c135afa671a
parent273c1f5fa733dd53fa1f85a2564bcf6f2c1192e4 (diff)
downloadpysnmp-1438ad8dd32f378791d064b94f4d891cafb9ca55.tar.gz
cosmetic fix to msgID usage
-rw-r--r--pysnmp/proto/mpmod/rfc2576.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pysnmp/proto/mpmod/rfc2576.py b/pysnmp/proto/mpmod/rfc2576.py
index 7b2a146..aa34603 100644
--- a/pysnmp/proto/mpmod/rfc2576.py
+++ b/pysnmp/proto/mpmod/rfc2576.py
@@ -232,9 +232,6 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.2.3
msgVersion = messageProcessingModel = msg.getComponentByPosition(0)
- pdu = msg.getComponentByPosition(2).getComponent()
- # (wild hack: use PDU reqID at MsgID)
- msgID = pdu.getComponentByPosition(0)
# rfc2576: 5.2.1
snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
@@ -292,6 +289,9 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.2.10
if pduType in rfc3411.responseClassPDUs:
+ # (wild hack: use PDU reqID at MsgID)
+ msgID = pdu.getComponentByPosition(0)
+
# 7.2.10a
try:
cachedReqParams = self._cache.popByMsgId(long(msgID))
@@ -344,6 +344,9 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.2.13
if pduType in rfc3411.confirmedClassPDUs:
+ # (wild hack: use PDU reqID at MsgID)
+ msgID = pdu.getComponentByPosition(0)
+
# rfc3412: 7.2.13a
snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
if securityEngineID != snmpEngineID.syntax: