Skip to contentSkip to conversation

Use whitelist along with resolving list to enable device filtering

RFC New Shermin Joy 1 participant 1 message Oct 9, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC v2 3/3 Use whitelist along with resolving list to enable device filtering

A peer device using an RPA can be added to the whitelist, if it is present in the resolving list.

---
 net/bluetooth/hci_request.c | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)
net/bluetooth/hci_request.c +24 -6
index 347054d..5be918a 100644
@@ -708,8 +708,14 @@ static u8 update_white_list(struct hci_request *req)
 		}
 
 		if (hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) {
-			/* White list can not be used with RPAs */
-			return 0x00;
+			/* White list can not be used with RPAs if address
+			 * resolution is disabled in the controller or the
+			 * peer device is not present in the resolving list.
+			 */
+			if (!hdev->le_ll_addr_resolve_enabled ||
+			    (!hci_resolving_list_lookup(hdev, &b->bdaddr,
+						       b->bdaddr_type)))
+				return 0x00;
 		}
 
 		white_list_entries++;
@@ -737,8 +743,14 @@ static u8 update_white_list(struct hci_request *req)
 
 		if (hci_find_irk_by_addr(hdev, &params->addr,
 					 params->addr_type)) {
-			/* White list can not be used with RPAs */
-			return 0x00;
+			/* White list can not be used with RPAs if address
+			 * resolution is disabled in the controller or the
+			 * peer device is not present in the resolving list.
+			 */
+			if (!hdev->le_ll_addr_resolve_enabled ||
+			    (!hci_resolving_list_lookup(hdev, &params->addr,
+						       params->addr_type)))
+				return 0x00;
 		}
 
 		white_list_entries++;
@@ -761,8 +773,14 @@ static u8 update_white_list(struct hci_request *req)
 
 		if (hci_find_irk_by_addr(hdev, &params->addr,
 					 params->addr_type)) {
-			/* White list can not be used with RPAs */
-			return 0x00;
+			/* White list can not be used with RPAs if address
+			 * resolution is disabled in the controller or the
+			 * peer device is not present in the resolving list.
+			 */
+			if (!hdev->le_ll_addr_resolve_enabled ||
+			    (!hci_resolving_list_lookup(hdev, &params->addr,
+						       params->addr_type)))
+				return 0x00;
 		}
 
 		white_list_entries++;
Signature · 1 line
1.9.1