Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 1/4] btio: Handle EOPNOTSUPP from accept() to prevent busy loop
@ 2026-06-09 16:50 Luiz Augusto von Dentz
  2026-06-09 16:50 ` [PATCH BlueZ v1 2/4] profile: Check if bearer is enabled on registration Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2026-06-09 16:50 UTC (permalink / raw)
  To: linux-bluetooth

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

When accept() returns EOPNOTSUPP on an L2CAP SEQPACKET server socket
(e.g. AVCTP browsing channel, PSM 0x1b), the error is permanent and
retrying will never succeed. Previously, only EBADFD was treated as
fatal, causing server_cb to return TRUE for EOPNOTSUPP. Since the fd
remains readable, this creates an infinite busy loop that hangs
bluetoothd.

Treat EOPNOTSUPP the same as EBADFD by returning FALSE to remove the
GLib IO watch and stop the loop.
---
 btio/btio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/btio/btio.c b/btio/btio.c
index cfaa9392de12..8d71a210d505 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -254,7 +254,7 @@ static gboolean server_cb(GIOChannel *io, GIOCondition cond,
 
 	cli_sock = accept(srv_sock, NULL, NULL);
 	if (cli_sock < 0) {
-		if (errno == EBADFD)
+		if (errno == EBADFD || errno == EOPNOTSUPP)
 			return FALSE;
 		return TRUE;
 	}
-- 
2.54.0


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

end of thread, other threads:[~2026-06-09 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 16:50 [PATCH BlueZ v1 1/4] btio: Handle EOPNOTSUPP from accept() to prevent busy loop Luiz Augusto von Dentz
2026-06-09 16:50 ` [PATCH BlueZ v1 2/4] profile: Check if bearer is enabled on registration Luiz Augusto von Dentz
2026-06-09 16:50 ` [PATCH BlueZ v1 3/4] plugins: Check btd_profile_register return value Luiz Augusto von Dentz
2026-06-09 16:50 ` [PATCH BlueZ v1 4/4] bearer: Check btd_opts.mode on btd_bearer_new Luiz Augusto von Dentz
2026-06-09 19:35 ` [BlueZ,v1,1/4] btio: Handle EOPNOTSUPP from accept() to prevent busy loop 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