device: Don't attempt to set auto_connect for devices using RPAs
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 17 Aug 2023 22:27:24 +0000 (15:27 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:03 +0000 (19:04 +0530)
Device using private address cannot be programmed into the auto_connect
list without them being paired and its IRK being distributed otherwise
there is no way to resolve it address and the command will fail.

src/device.c

index 807cf6eed173bbeb5b1e363cd98884d6081bf431..5f504a6b1ae2fda8f05d53667ef2d947b1dcd4fb 100644 (file)
@@ -2536,7 +2536,7 @@ static void device_set_auto_connect(struct btd_device *device, gboolean enable)
 {
        char addr[18];
 
-       if (!device || !device->le)
+       if (!device || !device->le || device_address_is_private(device))
                return;
 
        ba2str(&device->bdaddr, addr);