Wireshark-commits: [Wireshark-commits] master 32d1d96: androiddump: Fix tcpdump encap type signed/u
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=32d1d967210b707ef6b00d0c0bf1fd0fffc81f82
Submitter: "Roland Knall <rknall@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark
Commits:
32d1d96 by Mikael Kanstrup (mikael.kanstrup@xxxxxxxx):
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@xxxxxxxxx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@xxxxxxxxx>
Actions performed:
from 0371994 wslua: Improve parameter check in ProtoField.new()
add 32d1d96 androiddump: Fix tcpdump encap type signed/unsigned conversion error
Summary of changes:
extcap/androiddump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)