aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-09-04 13:23:04 -0400
committerAndersBroman <a.broman58@gmail.com>2022-11-01 17:26:14 +0000
commit80e287f82c084617b5624ceeba71de7f260f8d44 (patch)
treea10f656c4d765c7cb53f04e1c0c2ace4fd6f11a1 /epan
parent5723e43293b8f6a3fc2045ce6abbf1c5e5e66c59 (diff)
Reset the "current conversation elements" after each dissector call
packet_info has items that correspond to the single "most recent" conversation set via conversation_set_conv_addr_port_endpoints or conversation_set_elements_by_id. These should be reset after each call of a dissector, because they are only relevant for the dissector and any additional higher level dissectors it calls. Lower level protocols and protocols at the same level (i.e., in different PDUs of a shared lower level protocol) don't want to automatically use those conversation elements to find the current conversation. Separately, there should be an array or linked list of all conversation elements set in a packet, so that it can be used by the conversation table, conversation filters, etc., instead of just accessing the most recent conversation / conversation based on the last set address and ports. Fix #18278
Diffstat (limited to 'epan')
-rw-r--r--epan/packet.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/epan/packet.c b/epan/packet.c
index bf8267c3ac..f161346d76 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -861,6 +861,9 @@ call_dissector_work(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo
int len;
guint saved_layers_len = 0;
guint saved_tree_count = tree ? tree->tree_data->count : 0;
+ gboolean saved_use_conv_addr_port_endpoints;
+ struct conversation_addr_port_endpoints *saved_conv_addr_port_endpoints;
+ struct conversation_element *saved_conv_elements;
if (handle->protocol != NULL &&
!proto_is_protocol_enabled(handle->protocol)) {
@@ -875,6 +878,10 @@ call_dissector_work(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo
saved_layers_len = wmem_list_count(pinfo->layers);
DISSECTOR_ASSERT(saved_layers_len < PINFO_LAYER_MAX_RECURSION_DEPTH);
+ saved_use_conv_addr_port_endpoints = pinfo->use_conv_addr_port_endpoints;
+ saved_conv_addr_port_endpoints = pinfo->conv_addr_port_endpoints;
+ saved_conv_elements = pinfo->conv_elements;
+
/*
* can_desegment is set to 2 by anyone which offers the
* desegmentation api/service.
@@ -931,6 +938,9 @@ call_dissector_work(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo
}
pinfo->current_proto = saved_proto;
pinfo->can_desegment = saved_can_desegment;
+ pinfo->use_conv_addr_port_endpoints = saved_use_conv_addr_port_endpoints;
+ pinfo->conv_addr_port_endpoints = saved_conv_addr_port_endpoints;
+ pinfo->conv_elements = saved_conv_elements;
return len;
}