summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>2013-06-19 15:09:17 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-06-20 06:15:48 +0900
commitc75be1d5f0e318e2e5bfc9a6a741a32b26c03dee (patch)
treee5cd72bba97c9d04458d0ae05a5253a491f478fd
parent6796ffc9fa703df7827b84e4ba9f53639853d071 (diff)
of13 fix multipart reply parsing
make the parser return specific classes like OFPGroupFeaturesStatsReply instead of always returning OFPMultipartReply. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/ofproto_v1_3_parser.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py
index 6ab9e1a5..be1846f0 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -2032,12 +2032,14 @@ class OFPMultipartReply(MsgBase):
@classmethod
def parser(cls, datapath, version, msg_type, msg_len, xid, buf):
- msg = super(OFPMultipartReply, cls).parser(datapath, version, msg_type,
- msg_len, xid, buf)
- msg.type, msg.flags = struct.unpack_from(
+ type_, flags = struct.unpack_from(
ofproto_v1_3.OFP_MULTIPART_REPLY_PACK_STR, buffer(buf),
ofproto_v1_3.OFP_HEADER_SIZE)
- stats_type_cls = cls._STATS_MSG_TYPES.get(msg.type)
+ stats_type_cls = cls._STATS_MSG_TYPES.get(type_)
+ msg = super(OFPMultipartReply, stats_type_cls).parser(
+ datapath, version, msg_type, msg_len, xid, buf)
+ msg._type = type_
+ msg.flags = flags
offset = ofproto_v1_3.OFP_MULTIPART_REPLY_SIZE
body = []