[PATCH 7/7] Bluetooth LL Privacy update White list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Update white list filter policy of if LL Privacy is enabled
When Address Resolution is enabled and device is already in the white
list then follow the filter policy

Signed-off-by: Sathish Narsimman <sathish.narasimman@xxxxxxxxx>
---
 net/bluetooth/hci_request.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 12868caf50ea..47cb2602713a 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -711,7 +711,16 @@ static int add_to_white_list(struct hci_request *req,
 	/* White list can not be used with RPAs */
 	if (!allow_rpa &&
 	    hci_find_irk_by_addr(hdev, &params->addr, params->addr_type)) {
-		return -1;
+		/* White list can not be used with RPAs if address
+		 * resolution is disabled in the controller
+		 */
+		if (!hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION))
+			return -1;
+
+		/* if  the peer device is not present in the resolving list */
+		if (!hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list, &b->bdaddr,
+						     b->bdaddr_type))
+			return -1;
 	}
 
 	/* During suspend, only wakeable devices can be in whitelist */
@@ -768,7 +777,16 @@ static u8 update_white_list(struct hci_request *req)
 		/* White list can not be used with RPAs */
 		if (!allow_rpa &&
 		    hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) {
-			return 0x00;
+			/* White list can not be used with RPAs if address
+			 * resolution is disabled in the controller
+			 */
+			if (!hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION))
+				return 0x00;
+
+			/* if  the peer device is not present in the resolving list */
+			if (!hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list, &b->bdaddr,
+							     b->bdaddr_type))
+				return 0x00;
 		}
 
 		num_entries++;
-- 
2.17.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux