From c560908633d03ec640518604c2f978591d1ab878 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 6 May 2014 05:14:22 +0000 Subject: packet/bgp: fix bug in serializing AS PATH path attribute Signed-off-by: ISHIDA Wataru Signed-off-by: FUJITA Tomonori --- ryu/lib/packet/bgp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py index 06323a85..e488653d 100644 --- a/ryu/lib/packet/bgp.py +++ b/ryu/lib/packet/bgp.py @@ -1265,6 +1265,8 @@ class _BGPPathAttributeAsPathCommon(_PathAttribute): type_ = self._AS_SEQUENCE l = list(e) num_as = len(l) + if num_as == 0: + continue msg_pack_into(self._SEG_HDR_PACK_STR, buf, offset, type_, num_as) offset += struct.calcsize(self._SEG_HDR_PACK_STR) for i in l: -- cgit v1.2.3