From c8a1f9d46ef3cb05f18bba07816ff9f5f6a5d53e Mon Sep 17 00:00:00 2001 From: "michal.orynicz" Date: Tue, 12 Jan 2016 14:28:47 +0100 Subject: Fix issue with dumping to logcat_text from UPPER_PDU When using UPPER_PDU to wrap logcat text data it was not possible to dump underlying data to logcat textfiles. Add ability to write it down properly. Change-Id: Ia20142cc340f34d80de93e213084cf1df83099d6 Reviewed-on: https://code.wireshark.org/review/13230 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- wiretap/logcat_text.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'wiretap/logcat_text.c') diff --git a/wiretap/logcat_text.c b/wiretap/logcat_text.c index e3c0811c4e..870121a76e 100644 --- a/wiretap/logcat_text.c +++ b/wiretap/logcat_text.c @@ -432,6 +432,17 @@ static gboolean logcat_text_dump_text(wtap_dumper *wdh, switch (wdh->encap) { case WTAP_ENCAP_WIRESHARK_UPPER_PDU: + { + gint skipped_length; + + skipped_length = logcat_exported_pdu_length(pd); + pd += skipped_length; + + if (!wtap_dump_file_write(wdh, (const gchar*) pd, phdr->caplen - skipped_length, err)) { + return FALSE; + } + } + break; case WTAP_ENCAP_LOGCAT: /* Skip EXPORTED_PDU*/ if (wdh->encap == WTAP_ENCAP_WIRESHARK_UPPER_PDU) { -- cgit v1.2.1