summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/lib/packet/bgp.py2
1 files changed, 2 insertions, 0 deletions
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: