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

diff --git a/ryu/lib/packet/bfd.py b/ryu/lib/packet/bfd.py
index 8818da8..e12fec5 100644
--- a/ryu/lib/packet/bfd.py
+++ b/ryu/lib/packet/bfd.py
@@ -80,6 +80,7 @@ BFD Control packet format
 import binascii
 import hashlib
 import random
+import six
 import struct
 
 from . import packet_base
@@ -240,7 +241,7 @@ class bfd(packet_base.PacketBase):
         flags = flags & 0x3f
 
         if flags & BFD_FLAG_AUTH_PRESENT:
-            (auth_type,) = struct.unpack_from('!B', buf[cls._PACK_STR_LEN])
+            auth_type = six.indexbytes(buf, cls._PACK_STR_LEN)
             auth_cls = cls._auth_parsers[auth_type].\
                 parser(buf[cls._PACK_STR_LEN:])[0]
         else:
@@ -396,8 +397,7 @@ class SimplePassword(BFDAuth):
         (auth_type, auth_len) = cls.parser_hdr(buf)
         assert auth_type == cls.auth_type
 
-        (auth_key_id,) = struct.unpack_from(cls._PACK_STR,
-                                            buf[cls._PACK_HDR_STR_LEN])
+        auth_key_id = six.indexbytes(buf, cls._PACK_HDR_STR_LEN)
 
         password = buf[cls._PACK_HDR_STR_LEN + cls._PACK_STR_LEN:auth_len]
 
-- 
2.1.4


------------------------------------------------------------------------------
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