diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2021-02-07 15:07:48 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-02-08 09:45:49 +0000 |
commit | 37bef583dac539dd66e50c9f34a46563928356d2 (patch) | |
tree | 3fb06ba9243c9b59337abf7ab6fd9735a4a38bb9 /epan | |
parent | 1684ff0b4a5b858fc31834033c19cc91e7f2fd65 (diff) |
NAS: Put decoded user data in the top tree
Decoded user data as IP or Ethernet belongs in the top tree.
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-nas_5gs.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-nas_eps.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-nas_5gs.c b/epan/dissectors/packet-nas_5gs.c index eec82532ed..39416f9f05 100644 --- a/epan/dissectors/packet-nas_5gs.c +++ b/epan/dissectors/packet-nas_5gs.c @@ -1692,7 +1692,6 @@ static void nas_5gs_decode_user_data_cont(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo, guint32 offset, guint len, int hfindex) { - proto_tree *subtree; proto_item *item; item = proto_tree_add_item(tree, hfindex, tvb, offset, len, ENC_NA); @@ -1700,7 +1699,6 @@ nas_5gs_decode_user_data_cont(tvbuff_t* tvb, proto_tree* tree, packet_info* pinf tvbuff_t *user_data_cont_tvb; volatile dissector_handle_t handle; - subtree = proto_item_add_subtree(item, ett_nas_5gs_user_data_cont); user_data_cont_tvb = tvb_new_subset_length(tvb, offset, len); if (g_nas_5gs_decode_user_data_container_as == DECODE_USER_DATA_AS_IP) { guint8 first_byte = tvb_get_guint8(user_data_cont_tvb, 0); @@ -1721,9 +1719,11 @@ nas_5gs_decode_user_data_cont(tvbuff_t* tvb, proto_tree* tree, packet_info* pinf col_append_str(pinfo->cinfo, COL_INFO, ", "); col_set_fence(pinfo->cinfo, COL_INFO); TRY { - call_dissector_only(handle, user_data_cont_tvb, pinfo, subtree, NULL); + proto_tree *toptree = proto_tree_get_root(tree); + call_dissector_only(handle, user_data_cont_tvb, pinfo, toptree, NULL); } CATCH_BOUNDS_ERRORS { /* Dissection exception: message was probably non IP and heuristic was too weak */ + proto_tree *subtree = proto_item_add_subtree(item, ett_nas_5gs_user_data_cont); show_exception(user_data_cont_tvb, pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY } diff --git a/epan/dissectors/packet-nas_eps.c b/epan/dissectors/packet-nas_eps.c index 1565728fcd..52c2d40449 100644 --- a/epan/dissectors/packet-nas_eps.c +++ b/epan/dissectors/packet-nas_eps.c @@ -3855,11 +3855,9 @@ de_esm_user_data_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, it = proto_tree_add_item(tree, hf_nas_eps_esm_user_data_cont, tvb, offset, len, ENC_NA); if (g_nas_eps_decode_user_data_container_as != DECODE_USER_DATA_AS_NONE) { - proto_tree *subtree; tvbuff_t *user_data_cont_tvb; volatile dissector_handle_t handle; - subtree = proto_item_add_subtree(it, ett_nas_eps_esm_user_data_cont); user_data_cont_tvb = tvb_new_subset_length_caplen(tvb, offset, len, len); if (g_nas_eps_decode_user_data_container_as == DECODE_USER_DATA_AS_IP) { guint8 first_byte = tvb_get_guint8(user_data_cont_tvb, 0); @@ -3880,9 +3878,11 @@ de_esm_user_data_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, col_append_str(pinfo->cinfo, COL_INFO, ", "); col_set_fence(pinfo->cinfo, COL_INFO); TRY { - call_dissector_only(handle, user_data_cont_tvb, pinfo, subtree, NULL); + proto_tree *toptree = proto_tree_get_root(tree); + call_dissector_only(handle, user_data_cont_tvb, pinfo, toptree, NULL); } CATCH_BOUNDS_ERRORS { /* Dissection exception: message was probably non IP and heuristic was too weak */ + proto_tree *subtree = proto_item_add_subtree(it, ett_nas_eps_esm_user_data_cont); show_exception(user_data_cont_tvb, pinfo, subtree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY } |