diff options
author | Minoru TAKAHASHI <takahashi.minoru7@gmail.com> | 2016-01-21 13:32:24 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-01-21 23:01:17 +0900 |
commit | 75fe76c4a548f861ade1caaac2a5132ee9e92ad5 (patch) | |
tree | 73f094999db3eb4d7c58935862ca0308be31f8dc | |
parent | 97ebd2fc56fc5670fe3ecd89bdd3aad02b1ab322 (diff) |
ofproto/NXAction: Fix NXActionUnknown parsing
Exception error occurs when NXActionUnknown parsing,
because _subtype(NXActionUnknown class member variable) is not defined.
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/nx_actions.py | 1 | ||||
-rw-r--r-- | ryu/tests/packet_data/of14/5-12-ofp_flow_stats_reply.packet | bin | 536 -> 552 bytes | |||
-rw-r--r-- | ryu/tests/packet_data_generator/src/x5.erl | 2 | ||||
-rw-r--r-- | ryu/tests/unit/ofproto/json/of14/5-12-ofp_flow_stats_reply.packet.json | 13 |
4 files changed, 14 insertions, 2 deletions
diff --git a/ryu/ofproto/nx_actions.py b/ryu/ofproto/nx_actions.py index 2eba31b6..f0e8db8f 100644 --- a/ryu/ofproto/nx_actions.py +++ b/ryu/ofproto/nx_actions.py @@ -182,6 +182,7 @@ def generate(ofp_name, ofpp_name): class NXActionUnknown(NXAction): def __init__(self, subtype, data=None, type_=None, len_=None, experimenter=None): + self._subtype = subtype super(NXActionUnknown, self).__init__() self.data = data diff --git a/ryu/tests/packet_data/of14/5-12-ofp_flow_stats_reply.packet b/ryu/tests/packet_data/of14/5-12-ofp_flow_stats_reply.packet Binary files differindex adc26212..aa6462c5 100644 --- a/ryu/tests/packet_data/of14/5-12-ofp_flow_stats_reply.packet +++ b/ryu/tests/packet_data/of14/5-12-ofp_flow_stats_reply.packet diff --git a/ryu/tests/packet_data_generator/src/x5.erl b/ryu/tests/packet_data_generator/src/x5.erl index dae0e681..c9fa429b 100644 --- a/ryu/tests/packet_data_generator/src/x5.erl +++ b/ryu/tests/packet_data_generator/src/x5.erl @@ -443,6 +443,8 @@ x() -> #ofp_action_output{port = 6, max_len = no_buffer}, #ofp_action_experimenter{experimenter = 98765432, + data = <<"exp_data">>}, + #ofp_action_experimenter{experimenter = 8992, data = <<"exp_data">>} ]}, #ofp_instruction_apply_actions{ diff --git a/ryu/tests/unit/ofproto/json/of14/5-12-ofp_flow_stats_reply.packet.json b/ryu/tests/unit/ofproto/json/of14/5-12-ofp_flow_stats_reply.packet.json index 4d7e0273..88d2976a 100644 --- a/ryu/tests/unit/ofproto/json/of14/5-12-ofp_flow_stats_reply.packet.json +++ b/ryu/tests/unit/ofproto/json/of14/5-12-ofp_flow_stats_reply.packet.json @@ -259,9 +259,18 @@ "experimenter": 98765432, "type": 65535 } + }, + { + "NXActionUnknown": { + "len": 16, + "data": "cF9kYXRh", + "experimenter": 8992, + "type": 65535, + "subtype": 25976 + } } ], - "len": 176, + "len": 192, "type": 3 } }, @@ -312,7 +321,7 @@ } } ], - "length": 296, + "length": 312, "match": { "OFPMatch": { "length": 4, |