From 66507b90521f5f8252b23fec56e70a0580fac26c Mon Sep 17 00:00:00 2001 From: Mikael Kanstrup Date: Sat, 24 Jun 2017 16:24:52 +0200 Subject: [RFC]androiddump: Only filter CR/LFs on Windows Comments in code claim: "The data we are getting from the tcpdump stdoutput stream as the stdout is the text stream it is convertinng the 0A=0D0A; So we need to remove these extra character." This is not true on non-Windows systems at least so avoid the filter when not built for Windows. NOTE: A problem with the filter is that it operates on all bytes received on the socket, including packet data(!). Capturing data with CR/LFs (for example an HTTP request) will fail. Ideally the filter should be replaced with some other mechanism but as I don't have a Windows system to verify that the comment claims are valid, this change will at least make androiddump work on non-Windows systems. Bug: 13510 Change-Id: Ic00f44fa7516c0db7fc015ed8685deb365a347db Reviewed-on: https://code.wireshark.org/review/22397 Petri-Dish: Roland Knall Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- extcap/androiddump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extcap/androiddump.c b/extcap/androiddump.c index d49ce0102b..267d550740 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -2579,9 +2579,11 @@ static int capture_android_wifi_tcpdump(char *interface, char *fifo, gssize i = 0,read_offset,j=0; /*Filter the received data to get rid of unwanted 0DOA*/ for (i = 0; i < (used_buffer_length - 1); i++) { +#ifdef _WIN32 if (data[i] == 0x0d && data[i + 1] == 0x0a) { i++; } +#endif filter_buffer[filter_buffer_length++] = data[i]; } -- cgit v1.2.1