From 658c30dc4b98c7afd1f0a7a5f8380a9399cbb082 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 15 Nov 2018 15:34:01 -0800 Subject: Always use the input file's encapsulation for the output file. Using WTAP_ENCAP_PER_PACKET if there's more than one interface forces a format supporting multiple encapsulations even if all interfaces use the same encapsulation; there's no reason to force that - you might as well let the user specify pcap format, for example, if that's what they really want. (If there are multiple interfaces and they have different encapsulations, the file encapsulation will be WTAP_ENCAP_PER_PACKET *anyway*.) Change-Id: I0e65c06e1ae3ff159ccd27f72cc63014e30a58f3 Reviewed-on: https://code.wireshark.org/review/30658 Reviewed-by: Guy Harris --- tshark.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'tshark.c') diff --git a/tshark.c b/tshark.c index e519387ce1..172764ad06 100644 --- a/tshark.c +++ b/tshark.c @@ -3108,15 +3108,7 @@ process_cap_file(capture_file *cf, char *save_file, int out_file_type, /* Set up to write to the capture file. */ snapshot_length = wtap_snapshot_length(cf->provider.wth); wtap_dump_params_init(&ng_params, cf->provider.wth); -#ifdef PCAP_NG_DEFAULT - if (ng_params.idb_inf->interface_data->len > 1) { - linktype = WTAP_ENCAP_PER_PACKET; - } else { - linktype = wtap_file_encap(cf->provider.wth); - } -#else linktype = wtap_file_encap(cf->provider.wth); -#endif /* If we don't have an application name add Tshark */ if (wtap_block_get_string_option_value(g_array_index(ng_params.shb_hdrs, wtap_block_t, 0), OPT_SHB_USERAPPL, &shb_user_appl) != WTAP_OPTTYPE_SUCCESS) { -- cgit v1.2.3