summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYuichi Ito <ito.yuichi0@gmail.com>2013-10-09 17:02:43 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-10-15 08:21:06 +0900
commit3b29d45ebe8072343c23d803f8c6a96895594431 (patch)
treedebd7fe276e207a786c03a41ece0278024cc3243
parent05011f5116c6e64889059c8695744074b9041a0b (diff)
of13: correct parser() in several OFPActions
before applying this patch: - parser() of OFPActionDecMplsTtl calls itself recursively. - parser() of OFPActionDecNwTtl, OFPActionCopyTtlOut, OFPActionCopyTtlIn and OFPActionPopVlan fail by shortage of arguments. after applying this patch: - all parser() of OFPActions work nicely. Signed-off-by: itoyuichi <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/ofproto_v1_3_parser.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py
index 6a6035d9..b12865e6 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -2702,6 +2702,12 @@ class OFPActionDecMplsTtl(OFPAction):
def __init__(self, type_=None, len_=None):
super(OFPActionDecMplsTtl, self).__init__()
+ @classmethod
+ def parser(cls, buf, offset):
+ (type_, len_) = struct.unpack_from(
+ ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
+ return cls()
+
@OFPAction.register_action_type(ofproto_v1_3.OFPAT_SET_NW_TTL,
ofproto_v1_3.OFP_ACTION_NW_TTL_SIZE)
@@ -2745,7 +2751,8 @@ class OFPActionDecNwTtl(OFPAction):
@classmethod
def parser(cls, buf, offset):
- msg_pack_into(ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
+ (type_, len_) = struct.unpack_from(
+ ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
return cls()
@@ -2763,7 +2770,8 @@ class OFPActionCopyTtlOut(OFPAction):
@classmethod
def parser(cls, buf, offset):
- msg_pack_into(ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
+ (type_, len_) = struct.unpack_from(
+ ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
return cls()
@@ -2781,7 +2789,8 @@ class OFPActionCopyTtlIn(OFPAction):
@classmethod
def parser(cls, buf, offset):
- msg_pack_into(ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
+ (type_, len_) = struct.unpack_from(
+ ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
return cls()
@@ -2856,7 +2865,8 @@ class OFPActionPopVlan(OFPAction):
@classmethod
def parser(cls, buf, offset):
- msg_pack_into(ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
+ (type_, len_) = struct.unpack_from(
+ ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
return cls()