summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-02-03 23:10:40 +0100
committerAnders Broman <a.broman58@gmail.com>2016-02-05 05:35:02 +0000
commitcc679ca5ce9af9fb0dc9afe360d12654f6b4027a (patch)
treee68fdf9627cfbfbb4a827721d7a2db0d1f2cf421 /file.c
parent4c144c5d8c4c3f289a8b89a19bb9843cf9584d0e (diff)
downloadwireshark-cc679ca5ce9af9fb0dc9afe360d12654f6b4027a.tar.gz
Qt: Add check for field extractors
The proto tree is needed in several cases when using Lua field extractors, because they fetch values from the tree. Without a valid field extractor a Lua plugin may misbehave and display wrong column info. This fixes column issues when: - Calling resetColumns() in Qt. This involves adding a display filter, change time display format, change name resolution and other changes in UI which requires column updates. - Print summary lines. - Export as CSV and PSML. Change-Id: Ieed6f8578cdf2759f1f836cd8413a4529b7bbd80 Reviewed-on: https://code.wireshark.org/review/13708 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'file.c')
-rw-r--r--file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/file.c b/file.c
index db1f7194cc..cda78b19ed 100644
--- a/file.c
+++ b/file.c
@@ -2469,7 +2469,7 @@ cf_print_packets(capture_file *cf, print_args_t *print_args)
proto_tree_needed =
callback_args.print_args->print_dissections != print_dissections_none ||
callback_args.print_args->print_hex ||
- have_custom_cols(&cf->cinfo);
+ have_custom_cols(&cf->cinfo) || have_field_extractors();
epan_dissect_init(&callback_args.edt, cf->epan, proto_tree_needed, proto_tree_needed);
/* Iterate through the list of packets, printing the packets we were
@@ -2641,8 +2641,8 @@ cf_write_psml_packets(capture_file *cf, print_args_t *print_args)
callback_args.fh = fh;
/* Fill in the column information, only create the protocol tree
- if having custom columns. */
- proto_tree_needed = have_custom_cols(&cf->cinfo);
+ if having custom columns or field extractors. */
+ proto_tree_needed = have_custom_cols(&cf->cinfo) || have_field_extractors();
epan_dissect_init(&callback_args.edt, cf->epan, proto_tree_needed, proto_tree_needed);
/* Iterate through the list of packets, printing the packets we were
@@ -2721,8 +2721,8 @@ cf_write_csv_packets(capture_file *cf, print_args_t *print_args)
callback_args.fh = fh;
- /* only create the protocol tree if having custom columns. */
- proto_tree_needed = have_custom_cols(&cf->cinfo);
+ /* only create the protocol tree if having custom columns or field extractors. */
+ proto_tree_needed = have_custom_cols(&cf->cinfo) || have_field_extractors();
epan_dissect_init(&callback_args.edt, cf->epan, proto_tree_needed, proto_tree_needed);
/* Iterate through the list of packets, printing the packets we were