aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-03-13 09:13:27 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-03-13 09:13:27 +0000
commitead0764cd9fa16b3f44abe4d624ecdefd05c7419 (patch)
tree16cf6ec93c185dbb312a58992b0137da564b6e11 /tshark.c
parent45c342dfdb999404e356724ca8b594af3529a0a7 (diff)
A modified version of "pcapng: shd_userappl in newly created files"
to only add the name if no name if there yet. Original patch from Jose Pedro Oliveira. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6937 svn path=/trunk/; revision=41524
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tshark.c b/tshark.c
index 27bd9aa3b3..8be0382296 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2679,6 +2679,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
guint tap_flags;
wtapng_section_t *shb_hdr;
wtapng_iface_descriptions_t *idb_inf;
+ char appname[100];
shb_hdr = wtap_file_get_shb_info(cf->wth);
idb_inf = wtap_file_get_idb_info(cf->wth);
@@ -2701,6 +2702,10 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
/* Snapshot length of input file not known. */
snapshot_length = WTAP_MAX_PACKET_SIZE;
}
+ /* If we don't have an application name add Tshark */
+ if(shb_hdr->shb_user_appl == NULL)
+ g_snprintf(appname, sizeof(appname), "TShark " VERSION "%s", wireshark_svnversion);
+
pdh = wtap_dump_open_ng(save_file, out_file_type, linktype, snapshot_length,
FALSE /* compressed */, shb_hdr, idb_inf, &err);