aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/hci_request.c')
-rw-r--r--net/bluetooth/hci_request.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 41b5f3813f02..c78ee2dc9323 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -688,21 +688,29 @@ static u8 update_white_list(struct hci_request *req)
688 * command to remove it from the controller. 688 * command to remove it from the controller.
689 */ 689 */
690 list_for_each_entry(b, &hdev->le_white_list, list) { 690 list_for_each_entry(b, &hdev->le_white_list, list) {
691 struct hci_cp_le_del_from_white_list cp; 691 /* If the device is neither in pend_le_conns nor
692 * pend_le_reports then remove it from the whitelist.
693 */
694 if (!hci_pend_le_action_lookup(&hdev->pend_le_conns,
695 &b->bdaddr, b->bdaddr_type) &&
696 !hci_pend_le_action_lookup(&hdev->pend_le_reports,
697 &b->bdaddr, b->bdaddr_type)) {
698 struct hci_cp_le_del_from_white_list cp;
699
700 cp.bdaddr_type = b->bdaddr_type;
701 bacpy(&cp.bdaddr, &b->bdaddr);
692 702
693 if (hci_pend_le_action_lookup(&hdev->pend_le_conns, 703 hci_req_add(req, HCI_OP_LE_DEL_FROM_WHITE_LIST,
694 &b->bdaddr, b->bdaddr_type) || 704 sizeof(cp), &cp);
695 hci_pend_le_action_lookup(&hdev->pend_le_reports,
696 &b->bdaddr, b->bdaddr_type)) {
697 white_list_entries++;
698 continue; 705 continue;
699 } 706 }
700 707
701 cp.bdaddr_type = b->bdaddr_type; 708 if (hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) {
702 bacpy(&cp.bdaddr, &b->bdaddr); 709 /* White list can not be used with RPAs */
710 return 0x00;
711 }
703 712
704 hci_req_add(req, HCI_OP_LE_DEL_FROM_WHITE_LIST, 713 white_list_entries++;
705 sizeof(cp), &cp);
706 } 714 }
707 715
708 /* Since all no longer valid white list entries have been 716 /* Since all no longer valid white list entries have been