wireshark/extcap
Mikael Kanstrup 32d1d96721 androiddump: Fix tcpdump encap type signed/unsigned conversion error
androiddump determines encap type by reading the data link type
value from pcap content generated by tcpdump running on the device.
The data link type is converted from an uint type to an int type
because int is what the pcap/wtap API expects. However the signed
to unsigned conversion is performed on an 8-bit data value rather
than the full 32-bit value making DLT values larger than 127 fail.

Fix the unsigned to signed conversion by determining DLT from the
full 32-bit "network" field from pcap global header instead of
the 8-bit data char array. While at it also take caore of device
to host endianness conversion.

Fixes: v2.5.1rc0-65-gbfef57ebb7 ("androiddump: Fix and simplify tcpdump capture")
Fixes: v2.9.0rc0-694-gafd0eef4f6 ("androiddump: Fix tcpdump encap type when libwiretap is used")

Change-Id: I71629b166a6893763b16e9df33408fee8c99cbd2
Reviewed-on: https://code.wireshark.org/review/34788
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-10-16 11:53:04 +00:00
..
.editorconfig HTTPS In More Places, update some URLs. 2019-07-27 07:55:36 +00:00
CMakeLists.txt CMake: Fix extcap symlinks on macOS. 2019-09-10 18:20:57 +00:00
androiddump.c androiddump: Fix tcpdump encap type signed/unsigned conversion error 2019-10-16 11:53:04 +00:00
ciscodump.c Revert "CMake: Don't install HTML manuals twice" 2019-10-10 15:58:41 +00:00
dpauxmon.c If you use data_file_url(), you must first call init_progfile_dir(). 2019-04-08 02:57:53 +00:00
dpauxmon_user.h extcap: Support for DisplayPort AUX channel monitors 2018-05-14 10:44:37 +00:00
extcap-base.c extcap: save debug flag and use it to activate ssh debug. 2018-11-14 04:58:38 +00:00
extcap-base.h Put the main() and wmain() routines for CLI programs into a separate file. 2018-12-13 00:52:11 +00:00
randpktdump.c Revert "CMake: Don't install HTML manuals twice" 2019-10-10 15:58:41 +00:00
sdjournal.c Revert "CMake: Don't install HTML manuals twice" 2019-10-10 15:58:41 +00:00
ssh-base.c ssh-base: fix no previous prototype for ‘extcap_log’ [-Wmissing-prototypes] 2018-12-26 20:14:37 +00:00
ssh-base.h extcap: save debug flag and use it to activate ssh debug. 2018-11-14 04:58:38 +00:00
sshdump.c Revert "CMake: Don't install HTML manuals twice" 2019-10-10 15:58:41 +00:00
udpdump.c Revert "CMake: Don't install HTML manuals twice" 2019-10-10 15:58:41 +00:00