All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] device: fix auto connect with private addresses
@ 2025-08-26 11:43 Andreas Kemnade
  2025-08-26 13:05 ` [BlueZ] " bluez.test.bot
  2025-08-26 13:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Kemnade @ 2025-08-26 11:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andreas Kemnade

When an app is registered and a device gets paired,
device_set_auto_connect() can be called before the address is resolved.
Do not ignore the request but rather record the auto connect request so
that it can be enabled in device_update_addr.
---
 src/device.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index 0179c3dab..8b3e78995 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2205,7 +2205,7 @@ static void device_set_auto_connect(struct btd_device *device, gboolean enable)
 	char addr[18];
 	const char *bearer;
 
-	if (!device || !device->le || device_address_is_private(device))
+	if (!device || !device->le)
 		return;
 
 	ba2str(&device->bdaddr, addr);
@@ -2224,6 +2224,9 @@ static void device_set_auto_connect(struct btd_device *device, gboolean enable)
 		return;
 	}
 
+	if (device_address_is_private(device))
+		return;
+
 	/* Inhibit auto connect if BR/EDR bearer is preferred */
 	bearer = device_prefer_bearer_str(device);
 	if (bearer && !strcasecmp(bearer, "bredr"))
-- 
2.47.2


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

end of thread, other threads:[~2025-08-26 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 11:43 [PATCH BlueZ] device: fix auto connect with private addresses Andreas Kemnade
2025-08-26 13:05 ` [BlueZ] " bluez.test.bot
2025-08-26 13:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.