I've applied the following patch.

---
>From 41e3fe1db165ec379bb607324b66a2a6a66c991d Mon Sep 17 00:00:00 2001
From: FUJITA Tomonori <[email protected]>
Date: Sat, 30 Jun 2012 11:39:19 +0900
Subject: [PATCH] of1.2: add unittest workaround to OFPPortStatus parser

Add unittest workaround to OFPPortStatus parser. Another Option is
defining something like OFP_PORT_STATUS_PACK_STR0, 'B'. I don't care
much. Let's just do as we do with OF1.0.

Signed-off-by: FUJITA Tomonori <[email protected]>
---
 ryu/ofproto/ofproto_v1_2_parser.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_2_parser.py 
b/ryu/ofproto/ofproto_v1_2_parser.py
index bcf48b6..acbf5c7 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -286,9 +286,9 @@ class OFPPortStatus(MsgBase):
     def parser(cls, datapath, version, msg_type, msg_len, xid, buf):
         msg = super(OFPPortStatus, cls).parser(datapath, version, msg_type,
                                                msg_len, xid, buf)
-        (msg.reason,) = struct.unpack_from(
+        msg.reason = struct.unpack_from(
             ofproto_v1_2.OFP_PORT_STATUS_PACK_STR, msg.buf,
-            ofproto_v1_2.OFP_HEADER_SIZE)
+            ofproto_v1_2.OFP_HEADER_SIZE)[0]
         msg.desc = OFPPort.parser(msg.buf,
                                   ofproto_v1_2.OFP_PORT_STATUS_DESC_OFFSET)
         return msg
-- 
1.7.4.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to