summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/lib/packet/ospf.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ryu/lib/packet/ospf.py b/ryu/lib/packet/ospf.py
index 5f49402b..a776b94d 100644
--- a/ryu/lib/packet/ospf.py
+++ b/ryu/lib/packet/ospf.py
@@ -612,7 +612,7 @@ class OSPFMessage(packet_base.PacketBase, _TypeDisp):
self.authentication = authentication
@classmethod
- def parser(cls, buf):
+ def _parser(cls, buf):
if len(buf) < cls._HDR_LEN:
raise stream_parser.StreamParser.TooSmallException(
'%d < %d' % (len(buf), cls._HDR_LEN))
@@ -637,6 +637,13 @@ class OSPFMessage(packet_base.PacketBase, _TypeDisp):
return subcls(length, router_id, area_id, au_type, authentication,
checksum, version, **kwargs), None, rest
+ @classmethod
+ def parser(cls, buf):
+ try:
+ return cls._parser(buf)
+ except:
+ return None, None, buf
+
def serialize(self):
tail = self.serialize_tail()
self.length = self._HDR_LEN + len(tail)