Reported-by: Toshiki Tsuboi <[email protected]>
Signed-off-by: ISHIDA Wataru <[email protected]>
---
 ryu/lib/packet/bgp.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py
index b5d85d2..bd3304f 100644
--- a/ryu/lib/packet/bgp.py
+++ b/ryu/lib/packet/bgp.py
@@ -772,6 +772,13 @@ class _BinAddrPrefix(_AddrPrefix):
 
 class _LabelledAddrPrefix(_AddrPrefix):
     _LABEL_PACK_STR = '!3B'
+    # RFC3107
+    # 3. Carrying Label Mapping Information
+    # The label information carried (as part of NLRI) in the Withdrawn
+    # Routes field should be set to 0x800000.  (Of course, terminating the
+    # BGP session also withdraws all the previously advertised routes.)
+    #
+    _WITHDRAW_LABEL = 0x800000
 
     def __init__(self, length, addr, labels=[], **kwargs):
         assert isinstance(labels, list)
@@ -843,6 +850,8 @@ class _LabelledAddrPrefix(_AddrPrefix):
 
         while True:
             (label, rest) = cls._label_from_bin(rest)
+            if label == cls._WITHDRAW_LABEL:
+                break
             labels.append(label >> 4)
             if label & 1:  # bottom of stack
                 break
-- 
1.9.1


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to