diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-06-15 12:15:54 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-06-15 19:16:19 +0000 |
commit | 88bd50c592b0d24a12dd178ae2858444400a012f (patch) | |
tree | d1a3f5a50a2954edc5e5d7e9d0e36b42a646a24a /wiretap | |
parent | 5a73176a9dbc5c9637c8a5cc027ac4ccb2a633e0 (diff) |
Don't map the interface ID for records that don't pertain to an interface.
And revert to the previous behavior of map_phdr_interface_id(); that
change broke the mergecap tests when it was merging pcap files into a
pcapng file.
Change-Id: I2e079b0e87dce06e98faa9ab7615f9b9b2701b77
Reviewed-on: https://code.wireshark.org/review/15932
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/merge.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c index eced520ac7..6870e8cbeb 100644 --- a/wiretap/merge.c +++ b/wiretap/merge.c @@ -699,8 +699,6 @@ map_phdr_interface_id(struct wtap_pkthdr *phdr, const merge_in_file_t *in_file) if (phdr->presence_flags & WTAP_HAS_INTERFACE_ID) { current_interface_id = phdr->interface_id; - } else { - return TRUE; } if (current_interface_id >= in_file->idb_index_map->len) { @@ -1009,9 +1007,17 @@ merge_files(int out_fd, const gchar* out_filename, const int file_type, } if (file_type == WTAP_FILE_TYPE_SUBTYPE_PCAPNG) { - if (!map_phdr_interface_id(phdr, in_file)) { - status = MERGE_ERR_BAD_PHDR_INTERFACE_ID; - break; + /* + * XXX - We should do this only for record types + * that pertain to a particular interface; for + * now, we hardcode that, but we need to figure + * out a more general way to handle this. + */ + if (phdr->rec_type == REC_TYPE_PACKET) { + if (!map_phdr_interface_id(phdr, in_file)) { + status = MERGE_ERR_BAD_PHDR_INTERFACE_ID; + break; + } } } |