aboutsummaryrefslogtreecommitdiffstats
path: root/extcap
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@sony.com>2018-11-19 13:23:19 +0100
committerAnders Broman <a.broman58@gmail.com>2018-11-20 05:08:35 +0000
commit51fb5081b361870b1525c2457198a5d8c99032eb (patch)
tree17443aff5141a7983cfeee22eeabbeef949d9ec2 /extcap
parent57c3ebb396b3376f99886d160e3566bb9c39881c (diff)
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>
Diffstat (limited to 'extcap')
-rw-r--r--extcap/androiddump.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c
index 4a3a8870a5..fd9b8fa16f 100644
--- a/extcap/androiddump.c
+++ b/extcap/androiddump.c
@@ -508,14 +508,8 @@ static gboolean extcap_dumper_dump(struct extcap_dumper extcap_dumper,
rec.rec_header.packet_header.caplen -= (guint32)sizeof(own_pcap_bluetooth_h4_header);
buffer += sizeof(own_pcap_bluetooth_h4_header);
- rec.rec_header.packet_header.pkt_encap = WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR;
- }
- else if (extcap_dumper.encap == EXTCAP_ENCAP_ETHERNET) {
- rec.rec_header.packet_header.pkt_encap = WTAP_ENCAP_ETHERNET;
- }
- else {
- rec.rec_header.packet_header.pkt_encap = WTAP_ENCAP_WIRESHARK_UPPER_PDU;
}
+ rec.rec_header.packet_header.pkt_encap = extcap_dumper.encap;
if (!wtap_dump(extcap_dumper.dumper.wtap, &rec, (const guint8 *) buffer, &err, &err_info)) {
cfile_write_failure_message("androiddump", NULL, fifo, err, err_info,