summaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:25 +0000
commitf59ea5f7690c9a01ef6f7f6508084a66c40b1dae (patch)
tree482ee255d71f113be6c62e9ff3543fd6ebb9f12a /epan/packet.c
parentReleasing progress-linux version 4.2.2-1.1~progress7.99u1. (diff)
downloadwireshark-f59ea5f7690c9a01ef6f7f6508084a66c40b1dae.tar.xz
wireshark-f59ea5f7690c9a01ef6f7f6508084a66c40b1dae.zip
Merging upstream version 4.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/epan/packet.c b/epan/packet.c
index c4bcb4d8..5a4c70a1 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -880,13 +880,6 @@ static int
call_dissector_work_error(dissector_handle_t handle, tvbuff_t *tvb,
packet_info *pinfo_arg, proto_tree *tree, void *);
-/*
- * XXX packet_info.curr_layer_num is a guint8 and *_MAX_RECURSION_DEPTH is
- * 100 elsewhere in the code. We should arguably use the same value here,
- * but using that makes suite_wslua.case_wslua.test_wslua_dissector_fpm fail.
- */
-#define PINFO_LAYER_MAX_RECURSION_DEPTH 500
-
static int
call_dissector_work(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, gboolean add_proto_name, void *data)
@@ -908,7 +901,7 @@ call_dissector_work(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo
saved_proto = pinfo->current_proto;
saved_can_desegment = pinfo->can_desegment;
saved_layers_len = wmem_list_count(pinfo->layers);
- DISSECTOR_ASSERT(saved_layers_len < PINFO_LAYER_MAX_RECURSION_DEPTH);
+ DISSECTOR_ASSERT(saved_layers_len < prefs.gui_max_tree_depth);
/*
* can_desegment is set to 2 by anyone which offers the
@@ -2942,7 +2935,7 @@ dissector_try_heuristic(heur_dissector_list_t sub_dissectors, tvbuff_t *tvb,
saved_layers_len = wmem_list_count(pinfo->layers);
*heur_dtbl_entry = NULL;
- DISSECTOR_ASSERT(saved_layers_len < PINFO_LAYER_MAX_RECURSION_DEPTH);
+ DISSECTOR_ASSERT(saved_layers_len < prefs.gui_max_tree_depth);
for (entry = sub_dissectors->dissectors; entry != NULL;
entry = g_slist_next(entry)) {
@@ -3917,6 +3910,18 @@ prime_epan_dissect_with_postdissector_wanted_hfids(epan_dissect_t *edt)
}
}
+void
+increment_dissection_depth(packet_info *pinfo) {
+ pinfo->dissection_depth++;
+ DISSECTOR_ASSERT(pinfo->dissection_depth < (int)prefs.gui_max_tree_depth);
+}
+
+void
+decrement_dissection_depth(packet_info *pinfo) {
+ pinfo->dissection_depth--;
+ DISSECTOR_ASSERT(pinfo->dissection_depth >= 0);
+}
+
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*