packet/bgp: Support multiple BGP messages in a packet

This patch fixes to BGPMessage.parser() to return the reference to
its own class and to support multiple BGP messages in a single packet.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWASE Yusuke 2016-11-22 11:20:19 +09:00 committed by FUJITA Tomonori
parent 17acdbb610
commit 197a6c49a6

View File

@ -3600,7 +3600,7 @@ class BGPMessage(packet_base.PacketBase, _TypeDisp):
subcls = cls._lookup_type(type_)
kwargs = subcls.parser(binmsg)
return subcls(marker=marker, len_=len_, type_=type_,
**kwargs), None, rest
**kwargs), cls, rest
def serialize(self, payload=None, prev=None):
# fixup