From 3ca5bcc3cbe11d34a1f397f25b09a91a145f7ca5 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Wed, 22 Mar 2017 01:50:45 +0100 Subject: fixed crash on unknown PDU reporting --- pysnmp/proto/rfc3412.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pysnmp/proto') diff --git a/pysnmp/proto/rfc3412.py b/pysnmp/proto/rfc3412.py index d65019d3..97dca0ae 100644 --- a/pysnmp/proto/rfc3412.py +++ b/pysnmp/proto/rfc3412.py @@ -361,8 +361,6 @@ class MsgAndPduDispatcher(object): debug.logger & debug.flagDsp and debug.logger('receiveMessage: unhandled PDU type') - # XXX fails on unknown PDU - try: (destTransportDomain, destTransportAddress, @@ -374,7 +372,7 @@ class MsgAndPduDispatcher(object): statusInformation ) - except error.StatusInformation: + except (error.StatusInformation, error.ProtocolError): debug.logger & debug.flagDsp and debug.logger( 'receiveMessage: report failed, statusInformation %s' % sys.exc_info()[1]) return restOfWholeMsg -- cgit v1.2.1