summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2018-12-29 11:04:03 +0100
committerIlya Etingof <etingof@gmail.com>2018-12-29 11:04:03 +0100
commit6dd1d0bceb8a0d9bce603f2095a7971374e81f6f (patch)
tree874c0619ef90ad5b5eb39ecd1575605dc2c7d98f
parent920cbcab78f90013465beadbaf7421db1d2c220e (diff)
downloadpysnmp-git-6dd1d0bceb8a0d9bce603f2095a7971374e81f6f.tar.gz
Fix hlapi/v1arch GETNEXT EOM processing
The hlapi/v1arch GETNEXT command crashes when hitting end-of-mib condition. This patch fixes this.
-rw-r--r--pysnmp/hlapi/v1arch/asyncore/sync/cmdgen.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pysnmp/hlapi/v1arch/asyncore/sync/cmdgen.py b/pysnmp/hlapi/v1arch/asyncore/sync/cmdgen.py
index 9b6b2b24..8031cc57 100644
--- a/pysnmp/hlapi/v1arch/asyncore/sync/cmdgen.py
+++ b/pysnmp/hlapi/v1arch/asyncore/sync/cmdgen.py
@@ -318,7 +318,8 @@ def nextCmd(snmpDispatcher, authData, transportTarget,
while True:
if not varBinds:
- yield (errorIndication, errorStatus, errorIndex, varBindTable)
+ yield (errorIndication, errorStatus, errorIndex,
+ varBindTable and varBindTable[0] or [])
return
cmdgen.nextCmd(snmpDispatcher, authData, transportTarget,
@@ -329,7 +330,8 @@ def nextCmd(snmpDispatcher, authData, transportTarget,
errorIndication, errorStatus, errorIndex, varBindTable, varBinds = response
if errorIndication:
- yield (errorIndication, errorStatus, errorIndex, varBindTable)
+ yield (errorIndication, errorStatus, errorIndex,
+ varBindTable and varBindTable[0] or [])
return
elif errorStatus:
@@ -338,7 +340,8 @@ def nextCmd(snmpDispatcher, authData, transportTarget,
# from SNMPv1 Agent through internal pysnmp proxy.
errorStatus = errorStatus.clone(0)
errorIndex = errorIndex.clone(0)
- yield (errorIndication, errorStatus, errorIndex, varBindTable)
+ yield (errorIndication, errorStatus, errorIndex,
+ varBindTable and varBindTable[0] or [])
return
else: