summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2007-11-26 10:24:01 +0000
committerelie <elie>2007-11-26 10:24:01 +0000
commit3dbad5923fa69dbe5753eca62e5a01e7bc38efe1 (patch)
tree55c96927f45256c746042142985a3825832a1d3c
parent329e8d2c7dcee2ff9b5a85cdeeb2b54a6086a644 (diff)
downloadpysnmp-3dbad5923fa69dbe5753eca62e5a01e7bc38efe1.tar.gz
release SM state information properly
-rw-r--r--pysnmp/proto/mpmod/rfc2576.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pysnmp/proto/mpmod/rfc2576.py b/pysnmp/proto/mpmod/rfc2576.py
index 139e685..fd69f6a 100644
--- a/pysnmp/proto/mpmod/rfc2576.py
+++ b/pysnmp/proto/mpmod/rfc2576.py
@@ -288,6 +288,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
try:
cachedReqParams = self._cachePopByMsgId(long(msgID))
except error.ProtocolError:
+ smHandler.releaseStateInformation(securityStateReference)
raise error.StatusInformation(
errorIndication = 'dataMismatch'
)
@@ -310,11 +311,13 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
securityLevel != cachedReqParams['securityLevel'] or \
contextEngineId != cachedReqParams['contextEngineId'] or \
contextName != cachedReqParams['contextName']:
+ smHandler.releaseStateInformation(securityStateReference)
raise error.StatusInformation(
errorIndication = 'dataMismatch'
)
- # rfc3412: 7.2.12c -> noop
+ # rfc3412: 7.2.12c
+ smHandler.releaseStateInformation(securityStateReference)
# rfc3412: 7.2.12d
return ( messageProcessingModel,
@@ -336,6 +339,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.2.13a
snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
if securityEngineID != snmpEngineID.syntax:
+ smHandler.releaseStateInformation(securityStateReference)
raise error.StatusInformation(
errorIndication = 'engineIDMispatch'
)
@@ -377,6 +381,8 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.2.14
if rfc3411.unconfirmedClassPDUs.has_key(pduType):
+ # This is not specified explicitly in RFC
+ smHandler.releaseStateInformation(securityStateReference)
return ( messageProcessingModel,
securityModel,
securityName,
@@ -391,6 +397,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
statusInformation,
stateReference )
+ smHandler.releaseStateInformation(securityStateReference)
raise error.StatusInformation(
errorIndication = 'unsupportedPDUtype'
)