wireshark/extcap
Mikael Kanstrup 2fb9c8244e androiddump: Read btsnoop header separately from rest of data
The code to read and skip btsnoop header was written in a way where
it reads up to PACKET_LENGTH bytes of data, skips the header, then
move rest of data back start of buffer. So far so good. The code
then resets number of bytes used in buffer making it skip rest of
all data read.

Many times this works fine but only by luck. When there's no data
transfers first recv call will always only return the header
(sender side writes header separately right after accept).

When data transfers are ongoing first recv call will return both
header and data. Then initial data is lost but more importantly
risk parsing data with invalid offset.

Fix by reading btsnoop header separately from rest of data.

Change-Id: Ie52c33f943d8b311e0cd5638ec1a7d4840e271b8
Reviewed-on: https://code.wireshark.org/review/26659
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michal Labedzki <michal.labedzki@wireshark.org>
2018-03-27 15:22:12 +00:00
..
.editorconfig Move extcap EditorConfig settings to source dir 2016-03-23 00:24:52 +00:00
Makefile.am replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
androiddump.c androiddump: Read btsnoop header separately from rest of data 2018-03-27 15:22:12 +00:00
ciscodump.c replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
extcap-base.c replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
extcap-base.h replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
randpktdump.c replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
ssh-base.c replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
ssh-base.h replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
sshdump.c replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
udpdump.c replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00