Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: lib: Map Connection Failed to be Established to ETIMEDOUT
@ 2026-11-22 20:09 Simon Mikuda
  2026-11-22 22:55 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-22 20:09 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz

Connection Failed to be Established / Synchronization Timeout (0x3e) is
not handled by bt_to_errno() so it is reported to userspace as ENOSYS.

It is the error the controller uses when the first packets of an LE
connection or CIS are not received, and when it cannot synchronize to
a periodic advertising train or BIG in time, i.e. a timeout, so map it
to ETIMEDOUT like Connection Timeout (0x08).

This changes what userspace sees: connect() on an L2CAP LE or ISO (CIS)
socket that fails with 0x3e now reports ETIMEDOUT instead of ENOSYS.
BlueZ iso-tester "ISO Connect - Reject" expects ENOSYS for this case
and needs "iso-tester: Accept ETIMEDOUT for Connection Failed to be
Established" to pass.

Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/lib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
index cea21a4c49a0..0f84c397891a 100644
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -89,6 +89,7 @@ int bt_to_errno(__u16 code)
 		return ENOMEM;
 
 	case 0x08:
+	case 0x3e:
 		return ETIMEDOUT;
 
 	case 0x09:

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
-- 
2.43.0


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

end of thread, other threads:[~2026-11-22 22:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 20:09 [PATCH] Bluetooth: lib: Map Connection Failed to be Established to ETIMEDOUT Simon Mikuda
2026-11-22 22:55 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox