aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2017-01-16 08:15:03 +0100
committerAnders Broman <a.broman58@gmail.com>2017-01-18 09:44:47 +0000
commite021f74ed2200fc99e0850044e3edf739b6a5b6b (patch)
tree4a282848081bb3b892e07e2b3d970f8fcef12150
parentfe89424160a3ebf52a02b2b68ee3ff4ab3426431 (diff)
OpenFlow (v5/1.4): Add complete dissection of error messages
Like for OpenFlow (v4/1.3) (g4b7c2781fb) Change-Id: I61cfea015e548e5eaa37856df86e96bd0ba21795 Ping-Bug: 13221 Reviewed-on: https://code.wireshark.org/review/19644 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-openflow_v5.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/epan/dissectors/packet-openflow_v5.c b/epan/dissectors/packet-openflow_v5.c
index d85bc0db25..59b2d7905d 100644
--- a/epan/dissectors/packet-openflow_v5.c
+++ b/epan/dissectors/packet-openflow_v5.c
@@ -33,6 +33,7 @@
void proto_register_openflow_v5(void);
void proto_reg_handoff_openflow_v5(void);
+static int dissect_openflow_message_v5(tvbuff_t *, packet_info *, proto_tree *, int);
static dissector_handle_t eth_withoutfcs_handle;
@@ -1783,6 +1784,7 @@ static void
dissect_openflow_error_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
{
proto_tree *data_tree;
+ proto_item *data_ti;
guint16 error_type;
/* uint16_t type; */
@@ -1872,14 +1874,30 @@ dissect_openflow_error_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
case OFPET_SWITCH_CONFIG_FAILED:
case OFPET_ROLE_REQUEST_FAILED:
case OFPET_METER_MOD_FAILED:
- case OFPET_TABLE_FEATURES_FAILED:
+ case OFPET_TABLE_FEATURES_FAILED: {
/* uint8_t data[0]; contains at least the first 64 bytes of the failed request. */
- data_tree = proto_tree_add_subtree(tree, tvb, offset, length - offset, ett_openflow_v5_error_data, NULL, "Data");
+ gboolean save_in_error_pkt;
+
+ data_ti = proto_tree_add_item(tree, hf_openflow_v5_error_data_body, tvb, offset, length - 20, ENC_NA);
+ data_tree = proto_item_add_subtree(data_ti, ett_openflow_v5_error_data);
+
+ /* Save error pkt */
+ save_in_error_pkt = pinfo->flags.in_error_pkt;
+ pinfo->flags.in_error_pkt = TRUE;
+
+ /* Disable update/change of column info */
+ col_set_writable(pinfo->cinfo, -1, FALSE);
+
+ dissect_openflow_message_v5(tvb, pinfo, data_tree, offset);
- offset = dissect_openflow_header_v5(tvb, pinfo, data_tree, offset, length);
+ /* Restore the "we're inside an error packet" flag. */
+ pinfo->flags.in_error_pkt = save_in_error_pkt;
+
+ /* Restore the capability of update/change column info */
+ col_set_writable(pinfo->cinfo, -1, TRUE);
- proto_tree_add_item(data_tree, hf_openflow_v5_error_data_body, tvb, offset, length - 20, ENC_NA);
/*offset += length - 12;*/
+ }
break;
case OFPET_EXPERIMENTER: