aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2023-02-01 21:14:10 -0500
committerJohn Thacker <johnthacker@gmail.com>2023-02-04 13:40:00 +0000
commit8cddc32d35e36d9962495c3d4358842ea88aac41 (patch)
tree03be895989a3a589500239aedb0e6cb3cabdcb7d /wiretap
parent3aa44ba6aa39ed9123da5f8a91d1e901626513ca (diff)
cli: Process IDBs after the final packet record
Process IDBs that are read after the final packet record returned by wtap_read() in tshark, editcap, and mergecap. Ping #18449
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/merge.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c
index ed2f5d7b5d..0c3c919acf 100644
--- a/wiretap/merge.c
+++ b/wiretap/merge.c
@@ -1046,7 +1046,13 @@ merge_process_packets(wtap_dumper *pdh, const int file_type,
cb->callback_func(MERGE_EVENT_DONE, count, in_files, in_file_count, cb->data);
if (status == MERGE_OK || status == MERGE_USER_ABORTED) {
- /* Check for any NRBs or DSBs read after the last packet records. */
+ /* Check for IDBs, NRBs, or DSBs read after the last packet records. */
+ if (wtap_file_type_subtype_supports_block(file_type,
+ WTAP_BLOCK_IF_ID_AND_INFO) != BLOCK_NOT_SUPPORTED) {
+ if (!process_new_idbs(pdh, in_files, in_file_count, mode, idb_inf, err, err_info)) {
+ status = MERGE_ERR_CANT_WRITE_OUTFILE;
+ }
+ }
if (nrb_combined) {
for (guint j = 0; j < in_file_count; j++) {
in_file = &in_files[j];
@@ -1073,6 +1079,8 @@ merge_process_packets(wtap_dumper *pdh, const int file_type,
}
}
}
+ }
+ if (status == MERGE_OK || status == MERGE_USER_ABORTED) {
if (!wtap_dump_close(pdh, NULL, err, err_info))
status = MERGE_ERR_CANT_CLOSE_OUTFILE;
} else {