diff options
author | Ćukasz Rymanowski <lukasz.rymanowski@codecoup.pl> | 2023-03-12 00:36:40 +0100 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-03-14 12:48:46 -0700 |
commit | 6ae44c74aaf93468ddc626a02b8f0420a808b13e (patch) | |
tree | c497f98fe500fe93143ac62209d03beeb388f425 /tools | |
parent | 7b654b16fb04431178c13f96ec163779e3cfd752 (diff) | |
download | bluez-6ae44c74aaf93468ddc626a02b8f0420a808b13e.tar.gz |
btmon: Fix decoding truncated data
Some platforms use different filtering and for this purpose,
some of the ACL/SCO/ISO/SDP data is truncated.
In such a case, included length is smaller than the original size.
Without this fix, btmon stops working after first truncated packet.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/btsnoop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/btsnoop.c b/tools/btsnoop.c index a0d6cf356..efaa45db4 100644 --- a/tools/btsnoop.c +++ b/tools/btsnoop.c @@ -283,7 +283,7 @@ next_packet: if (len < 0 || len != BTSNOOP_PKT_SIZE) goto close_input; - toread = be32toh(pkt.size); + toread = be32toh(pkt.len); flags = be32toh(pkt.flags); opcode = flags & 0x00ff; @@ -356,7 +356,7 @@ next_packet: if (len < 0 || len != BTSNOOP_PKT_SIZE) goto close_input; - toread = be32toh(pkt.size); + toread = be32toh(pkt.len); flags = be32toh(pkt.flags); opcode = flags & 0x00ff; @@ -433,7 +433,7 @@ next_packet: if (len < 0 || len != BTSNOOP_PKT_SIZE) goto close_input; - toread = be32toh(pkt.size); + toread = be32toh(pkt.len); len = read(fd, buf, toread); if (len < 0 || len != (ssize_t) toread) { |