androiddump: Add packets with same encap type as used when open wtap
authorMikael Kanstrup <mikael.kanstrup@sony.com>
Mon, 19 Nov 2018 12:23:19 +0000 (13:23 +0100)
committerAnders Broman <a.broman58@gmail.com>
Tue, 20 Nov 2018 05:08:35 +0000 (05:08 +0000)
commit51fb5081b361870b1525c2457198a5d8c99032eb
tree17443aff5141a7983cfeee22eeabbeef949d9ec2
parent57c3ebb396b3376f99886d160e3566bb9c39881c
androiddump: Add packets with same encap type as used when open wtap

Already when selecting the extcap interface to use the encap type is
known. For some reason when adding packets the type is explicitly
checked for certain values and if not known type is set to
WTAP_ENCAP_WIRESHARK_UPPER_PDU.

This conversion break tcpdump function for all but ETHERNET interface
type. For example NLMON and 802.11 radiotap interfaces does not work.

This problem has probably been there since quite a while back but was not
seen (in the sense that current capture looked OK). Though when:

"3aec5e1 Catch attempts to write multiple encapsulation types if unsupported."

got applied the encap type mismatch is now detected and packet capture stops.
As encap type is known already when selecting the interface to use, fix
this by simply reusing the initial value when dumping the packets.

Change-Id: Ica9824e715c47b285c985ea48cbae0e10e18d542
Reviewed-on: https://code.wireshark.org/review/30715
Reviewed-by: Anders Broman <a.broman58@gmail.com>
extcap/androiddump.c