Skip to content

Commit 1fb17df

Browse files
nsathish41holtmann
authored andcommitted
Bluetooth: Fix: LL PRivacy BLE device fails to connect
When adding device to white list the device is added to resolving list also. It has to be added only when HCI_ENABLE_LL_PRIVACY flag is set. HCI_ENABLE_LL_PRIVACY flag has to be tested before adding/deleting devices to resolving list. use_ll_privacy macro is used only to check if controller supports LL_Privacy. https://bugzilla.kernel.org/show_bug.cgi?id=209745 Fixes: 0eee35b ("Bluetooth: Update resolving list when updating whitelist") Signed-off-by: Sathish Narasimman <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 1996d9c commit 1fb17df

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

net/bluetooth/hci_request.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ static void del_from_white_list(struct hci_request *req, bdaddr_t *bdaddr,
698698
cp.bdaddr_type);
699699
hci_req_add(req, HCI_OP_LE_DEL_FROM_WHITE_LIST, sizeof(cp), &cp);
700700

701-
if (use_ll_privacy(req->hdev)) {
701+
if (use_ll_privacy(req->hdev) &&
702+
hci_dev_test_flag(req->hdev, HCI_ENABLE_LL_PRIVACY)) {
702703
struct smp_irk *irk;
703704

704705
irk = hci_find_irk_by_addr(req->hdev, bdaddr, bdaddr_type);
@@ -732,7 +733,8 @@ static int add_to_white_list(struct hci_request *req,
732733
return -1;
733734

734735
/* White list can not be used with RPAs */
735-
if (!allow_rpa && !use_ll_privacy(hdev) &&
736+
if (!allow_rpa &&
737+
!hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) &&
736738
hci_find_irk_by_addr(hdev, &params->addr, params->addr_type)) {
737739
return -1;
738740
}
@@ -750,7 +752,8 @@ static int add_to_white_list(struct hci_request *req,
750752
cp.bdaddr_type);
751753
hci_req_add(req, HCI_OP_LE_ADD_TO_WHITE_LIST, sizeof(cp), &cp);
752754

753-
if (use_ll_privacy(hdev)) {
755+
if (use_ll_privacy(hdev) &&
756+
hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY)) {
754757
struct smp_irk *irk;
755758

756759
irk = hci_find_irk_by_addr(hdev, &params->addr,
@@ -812,7 +815,8 @@ static u8 update_white_list(struct hci_request *req)
812815
}
813816

814817
/* White list can not be used with RPAs */
815-
if (!allow_rpa && !use_ll_privacy(hdev) &&
818+
if (!allow_rpa &&
819+
!hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) &&
816820
hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) {
817821
return 0x00;
818822
}

0 commit comments

Comments
 (0)