linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] monitor: Print data if LTV and data length don't match
@ 2025-10-22 18:00 Luiz Augusto von Dentz
  2025-10-22 19:43 ` [BlueZ,v1] " bluez.test.bot
  2025-10-22 21:29 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-10-22 18:00 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If data length and LTV don't match this should be made visible so
issues like the data coming as all zeros as bellow can be detected:

> HCI Event: LE Meta Event (0x3e) plen 50
      LE Periodic Advertising Report (0x0f)
        Sync handle: 64
        TX power: 127 dbm (0x7f)
        RSSI: -55 dBm (0xc9)
        CTE Type: No Constant Tone Extension (0xff)
        Data status: Complete
        Data length: 0x2a

Versus:

> HCI Event: LE Meta Event (0x3e) plen 50
      LE Periodic Advertising Report (0x0f)
        Sync handle: 64
        TX power: 127 dbm (0x7f)
        RSSI: -55 dBm (0xc9)
        CTE Type: No Constant Tone Extension (0xff)
        Data status: Complete
        Data length: 0x2a
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        00 00 00 00 00 00 00 00 00 00                    ..........
---
 monitor/packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index dd808deaa79f..22708689fe03 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -4133,7 +4133,7 @@ static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le)
 		eir += field_len + 1;
 	}
 
-	if (len < eir_len && eir[0] != 0)
+	if (len < eir_len)
 		packet_hexdump(eir, eir_len - len);
 }
 
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-22 21:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22 18:00 [PATCH BlueZ v1] monitor: Print data if LTV and data length don't match Luiz Augusto von Dentz
2025-10-22 19:43 ` [BlueZ,v1] " bluez.test.bot
2025-10-22 21:29 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).