diff options
author | Mikael Kanstrup <mikael.kanstrup@gmail.com> | 2017-06-24 16:24:52 +0200 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2017-06-26 11:17:30 +0000 |
commit | 66507b90521f5f8252b23fec56e70a0580fac26c (patch) | |
tree | 5f73fca1a3f763daf1f1ae01f97853ab9c0fad37 /extcap | |
parent | 7ecea315811c60530a036aecdd87fa504421e990 (diff) |
[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 <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap')
-rw-r--r-- | extcap/androiddump.c | 2 |
1 files changed, 2 insertions, 0 deletions
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]; } |