aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Offord <paul.offord@advance7.com>2017-10-26 23:08:43 +0100
committerMichael Mann <mmann78@netscape.net>2017-10-27 01:40:51 +0000
commit1ceab868cd0c86e1a64e0b80150163a5b87b51ea (patch)
tree658e514bd951bd2ae36605fe7717ed38e1ef7e08
parent4e4f1debb75bece8f0a130d2f356f12bd5be0f00 (diff)
TRANSUM: File loading slow with transum enabled
This change improves performance through better handling of SYN - SYN/ACK pairs. Bug: 14094 Change-Id: Ie479f1b69fa48f85a2ed9f8f173533db25582bbd Reviewed-on: https://code.wireshark.org/review/24090 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--plugins/transum/CMakeLists.txt2
-rw-r--r--plugins/transum/packet-transum.c27
2 files changed, 19 insertions, 10 deletions
diff --git a/plugins/transum/CMakeLists.txt b/plugins/transum/CMakeLists.txt
index fecc838888..f7b1c9367d 100644
--- a/plugins/transum/CMakeLists.txt
+++ b/plugins/transum/CMakeLists.txt
@@ -22,7 +22,7 @@
include(WiresharkPlugin)
# Plugin name and version info (major minor micro extra)
-set_module_info(transum 2 0 3 0)
+set_module_info(transum 2 0 4 0)
set(DISSECTOR_SRC
packet-transum.c
diff --git a/plugins/transum/packet-transum.c b/plugins/transum/packet-transum.c
index c70028b15c..0d08d722dc 100644
--- a/plugins/transum/packet-transum.c
+++ b/plugins/transum/packet-transum.c
@@ -269,6 +269,10 @@ static RRPD *find_latest_rrpd(RRPD *in_rrpd, int state)
RRPD *rrpd_index = NULL, *rrpd;
wmem_list_frame_t* i;
+ /* If this is a SYN from C2S there is no point searching the list */
+ if (in_rrpd->c2s && in_rrpd->calculation == RTE_CALC_SYN)
+ return NULL;
+
for (i = wmem_list_tail(rrpd_list); i != NULL; i = wmem_list_frame_prev(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
@@ -495,18 +499,23 @@ static void update_rrpd_list_entry_req(RRPD *in_rrpd)
{
while (TRUE)
{
- match = find_latest_rrpd(in_rrpd, RRPD_STATE_1);
- if (match != NULL) /* Check to cover TCP Reassembly enabled */
+ if (preferences.reassembly)
{
- update_rrpd_list_entry(match, in_rrpd);
- break;
+ match = find_latest_rrpd(in_rrpd, RRPD_STATE_1);
+ if (match != NULL) /* Check to cover TCP Reassembly enabled */
+ {
+ update_rrpd_list_entry(match, in_rrpd);
+ break;
+ }
}
-
- match = find_latest_rrpd(in_rrpd, RRPD_STATE_4);
- if (match != NULL)
+ else
{
- update_rrpd_list_entry(match, in_rrpd);
- break;
+ match = find_latest_rrpd(in_rrpd, RRPD_STATE_4);
+ if (match != NULL)
+ {
+ update_rrpd_list_entry(match, in_rrpd);
+ break;
+ }
}
/* No entries and so add one */