Make hf_mysql_request cover the *entire* request.

The request doesn't correspond to the request command coe, it
corresponds to the entire request; create it as an item covering the
rest of the packet, and finish it up by setting the length appropriately.

Change-Id: Ib0c044c0c878f1cb2fa0d11deb04b4d31a8a825f
Reviewed-on: https://code.wireshark.org/review/22796
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2017-07-25 15:42:46 -07:00
parent 9c80c4d5a2
commit efbefe2f4c
1 changed files with 7 additions and 5 deletions

View File

@ -1306,7 +1306,7 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset,
{
gint opcode;
gint lenstr;
proto_item *tf = NULL, *ti;
proto_item *request_item, *tf = NULL, *ti;
proto_item *req_tree;
guint32 stmt_id;
my_stmt_data_t *stmt_data;
@ -1316,14 +1316,14 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset,
return mysql_dissect_auth_switch_response(tvb, pinfo, offset, tree, conn_data);
}
tf = proto_tree_add_item(tree, hf_mysql_request, tvb, offset, 1, ENC_NA);
req_tree = proto_item_add_subtree(tf, ett_request);
request_item = proto_tree_add_item(tree, hf_mysql_request, tvb, offset, -1, ENC_NA);
req_tree = proto_item_add_subtree(request_item, ett_request);
opcode = tvb_get_guint8(tvb, offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(opcode, &mysql_command_vals_ext, "Unknown (%u)"));
proto_tree_add_item(req_tree, hf_mysql_command, tvb, offset, 1, ENC_NA);
proto_item_append_text(tf, " %s", val_to_str_ext(opcode, &mysql_command_vals_ext, "Unknown (%u)"));
proto_item_append_text(request_item, " %s", val_to_str_ext(opcode, &mysql_command_vals_ext, "Unknown (%u)"));
offset += 1;
@ -1454,7 +1454,8 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset,
case MYSQL_REFRESH:
proto_tree_add_bitmask_with_flags(req_tree, tvb, offset,
hf_mysql_refresh, ett_refresh, mysql_rfsh_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
hf_mysql_refresh, ett_refresh, mysql_rfsh_flags,
ENC_BIG_ENDIAN, BMT_NO_APPEND);
offset += 1;
mysql_set_conn_state(pinfo, conn_data, RESPONSE_OK);
break;
@ -1595,6 +1596,7 @@ hf_mysql_refresh, ett_refresh, mysql_rfsh_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
mysql_set_conn_state(pinfo, conn_data, UNDEFINED);
}
proto_item_set_end(request_item, tvb, offset);
return offset;
}