Avoid hitting the assert in OFPAction class' parser method.
Signed-off-by: FUJITA Tomonori <[email protected]>
---
ryu/ofproto/ofproto_v1_0_parser.py | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py
b/ryu/ofproto/ofproto_v1_0_parser.py
index 3cb6830..d1bdee3 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -212,6 +212,21 @@ class OFPActionVlanPcp(OFPAction):
buf, offset, self.type, self.len, self.vlan_pcp)
[email protected]_action_type(ofproto_v1_0.OFPAT_STRIP_VLAN,
+ ofproto_v1_0.OFP_ACTION_HEADER_SIZE)
+class OFPActionStripVlan(OFPAction):
+ def __init__(self):
+ super(OFPActionStripVlan, self).__init__()
+
+ @classmethod
+ def parser(cls, buf, offset):
+ type_, len_ = struct.unpack_from(
+ ofproto_v1_0.OFP_ACTION_HEADER_PACK_STR, buf, offset)
+ assert type_ == ofproto_v1_0.OFPAT_STRIP_VLAN
+ assert len_ == ofproto_v1_0.OFP_ACTION_HEADER_SIZE
+ return cls()
+
+
class OFPActionDlAddr(OFPAction):
def __init__(self, dl_addr):
super(OFPActionDlAddr, self).__init__()
--
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