From 847c25c5a7e7c5653870c4bd60625da1c64c86f1 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 12 Apr 2017 13:52:07 -0700 Subject: Prime the epan_dissect_t with postdissector wanted fields if necessary. This makes sure that postdissectors that indicate that they need certain fields in the first pass will get them. While we're at it: Fix the field-fetching code in TRANSUM not to assume it got any instances of the field being fetched. Rename process_packet_first_pass() in sharkd to process_packet(), as it's the only routine in sharkd that processes packets. Rename process_packet() in tshark and tfshark to process_packet_single_pass(), as it's what's used if we're only doing one-pass analysis. Clean up comments and whitespace. Change-Id: I3769af952c66f5ca4b68002ad6213858ab9cab9b Reviewed-on: https://code.wireshark.org/review/21063 Reviewed-by: Guy Harris --- file.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'file.c') diff --git a/file.c b/file.c index 865b7703b0..d0b8ff2fb4 100644 --- a/file.c +++ b/file.c @@ -1163,6 +1163,12 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, } #endif + if (fdata->flags.visited) { + /* This is the first pass, so prime the epan_dissect_t with the + fields postdissectors want on the first pass. */ + prime_epan_dissect_with_postdissector_wanted_fields(edt); + } + /* Dissect the frame. */ epan_dissect_run_with_taps(edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, buf), fdata, cinfo); -- cgit v1.2.1