diff options
author | elie <elie> | 2013-08-24 23:13:55 +0000 |
---|---|---|
committer | elie <elie> | 2013-08-24 23:13:55 +0000 |
commit | b704ce7e0d59189ab63d9ea1fa17b25017cc4dce (patch) | |
tree | 4bd605f6e028db57ea55757ef39614b75c170f9c /pysnmp/proto | |
parent | 0e865e60133db95c0870cd2a91127f8ff374a2b0 (diff) | |
download | pysnmp-b704ce7e0d59189ab63d9ea1fa17b25017cc4dce.tar.gz |
fix to message processing module which used to refer to a bogus
stateReference in some cases what causes SNMP engine crashes
Diffstat (limited to 'pysnmp/proto')
-rw-r--r-- | pysnmp/proto/mpmod/rfc2576.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pysnmp/proto/mpmod/rfc2576.py b/pysnmp/proto/mpmod/rfc2576.py index eb7ec31..5b6f6ce 100644 --- a/pysnmp/proto/mpmod/rfc2576.py +++ b/pysnmp/proto/mpmod/rfc2576.py @@ -131,6 +131,10 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel): snmpEngineID = snmpEngineID.syntax # rfc3412: 7.1.2.b + if stateReference is None: + raise error.StatusInformation( + errorIndication = errind.nonReportable + ) cachedParams = self._cache.popByStateRef(stateReference) msgID = cachedParams['msgID'] contextEngineId = cachedParams['contextEngineId'] @@ -152,7 +156,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel): # rfc3412: 7.1.3b (always discard) raise error.StatusInformation( errorIndication = errind.nonReportable - ) + ) # rfc3412: 7.1.4 # Since there's no SNMP engine identification in v1/2c, @@ -283,10 +287,6 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel): pduVersion = msgVersion pduType = pdu.tagSet - # XXX use cache - # set stateref to null as in v3 model - stateReference = securityStateReference - # rfc3412: 7.2.8, 7.2.9 -> noop # rfc3412: 7.2.10 @@ -308,6 +308,10 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel): else: sendPduHandle = None + # state is only saved for incoming confirmed-type requests + stateReference = None + + # no error by default statusInformation = None # rfc3412: 7.2.11 -> noop |