mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-22 09:01:22 +01:00
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 <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
f4df6174b2
commit
23bd7d88e1
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user