Bluetooth: hci_sync: scan unfiltered for host-resolved RPAs

Restore unfiltered scanning for pending IRK peers when the controller
cannot resolve private addresses. Keep accept-list filtering while
suspended and when forced by periodic advertising synchronization.

Fixes: e209e5ccc5 ("Bluetooth: MGMT: Mark LL Privacy as stable")
Assisted-by: OpenCode:gpt-6.1-sol
Signed-off-by: Kyle Pepper <cochcoder@proton.me>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Kyle Pepper 2026-10-14 05:16:20 +00:00 committed by Luiz Augusto von Dentz
parent 5874f8d032
commit 397464709a

View File

@ -2618,7 +2618,7 @@ static int hci_le_set_privacy_mode_sync(struct hci_dev *hdev,
*/
static int hci_le_add_accept_list_sync(struct hci_dev *hdev,
struct conn_params *params,
u8 *num_entries)
u8 *num_entries, bool force_filter)
{
struct hci_cp_le_add_to_accept_list cp;
int err;
@ -2631,6 +2631,11 @@ static int hci_le_add_accept_list_sync(struct hci_dev *hdev,
return 0;
}
/* Host-resolved peers need unfiltered scanning while awake. */
if (!force_filter && !hdev->suspended && !ll_privacy_capable(hdev) &&
hci_find_irk_by_addr(hdev, &params->addr, params->addr_type))
return -EINVAL;
/* Select filter policy to accept all advertising */
if (*num_entries >= hdev->le_accept_list_size)
return -ENOSPC;
@ -2956,7 +2961,7 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
num_entries = 1;
err = hci_le_add_accept_list_sync(hdev, &pa,
&num_entries);
&num_entries, true);
goto done;
} else {
rcu_read_unlock();
@ -3020,7 +3025,7 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
for (i = 0; i < n; ++i) {
err = hci_le_add_accept_list_sync(hdev, &params[i],
&num_entries);
&num_entries, false);
if (err) {
kvfree(params);
goto done;
@ -3042,7 +3047,7 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
for (i = 0; i < n; ++i) {
err = hci_le_add_accept_list_sync(hdev, &params[i],
&num_entries);
&num_entries, false);
if (err) {
kvfree(params);
goto done;