summaryrefslogtreecommitdiff
path: root/wiretap/merge.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-07-27 14:31:21 -0700
committerGuy Harris <guy@alum.mit.edu>2016-07-27 21:32:09 +0000
commit93d5df468fc9013debe4a30f6f670eeedc01c911 (patch)
tree3173af97880f436173d4b3c23cb7d5e7c9234e6e /wiretap/merge.c
parente8f4fea259bbc7e738ba41331177b5cda0fddc7e (diff)
downloadwireshark-93d5df468fc9013debe4a30f6f670eeedc01c911.tar.gz
If we don't get any OS information, remove the old OS information.
The old information is copied over from one of the input files; if we don't have information about the OS on the machine writing the *output* file, just throw the old information away. (We need a better way to preserve information from the input files; perhaps this: http://www.winpcap.org/pipermail/pcap-ng-format/2016-June/000362.html might work.) Change-Id: Ia25771736d267173f2b6949a91e81e217ee7d16f Reviewed-on: https://code.wireshark.org/review/16730 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/merge.c')
-rw-r--r--wiretap/merge.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c
index 4c14b1efaf..5b771d981e 100644
--- a/wiretap/merge.c
+++ b/wiretap/merge.c
@@ -418,6 +418,11 @@ create_shb_header(const merge_in_file_t *in_files, const guint in_file_count,
wtap_block_set_string_option_value(shb_hdr, OPT_SHB_OS, opt_str, opt_len); /* UTF-8 string containing the name */
/* of the operating system used to create this section. */
g_free(opt_str);
+ } else {
+ /*
+ * No OS information; remove the old version.
+ */
+ wtap_block_remove_option(shb_hdr, OPT_SHB_OS);
}
wtap_block_set_string_option_value(shb_hdr, OPT_SHB_USERAPPL, (char*)app_name, app_name ? strlen(app_name): 0 ); /* NULL if not available, UTF-8 string containing the name */
/* of the application used to create this section. */