Signed-off-by: IWASE Yusuke <[email protected]>
---
 ryu/lib/packet/bgp.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py
index 697eff3..457f87b 100644
--- a/ryu/lib/packet/bgp.py
+++ b/ryu/lib/packet/bgp.py
@@ -3321,13 +3321,13 @@ class BGPNotification(BGPMessage):
     def __init__(self,
                  error_code,
                  error_subcode,
-                 data='',
+                 data=None,
                  type_=BGP_MSG_NOTIFICATION, len_=None, marker=None):
         super(BGPNotification, self).__init__(marker=marker, len_=len_,
                                               type_=type_)
         self.error_code = error_code
         self.error_subcode = error_subcode
-        self.data = data
+        self.data = data if data is not None else b''
 
     @classmethod
     def parser(cls, buf):
@@ -3343,7 +3343,7 @@ class BGPNotification(BGPMessage):
     def serialize_tail(self):
         msg = bytearray(struct.pack(self._PACK_STR, self.error_code,
                                     self.error_subcode))
-        msg += self.data
+        msg += six.binary_type(self.data)
         return msg
 
     @property
-- 
2.7.4


------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to