Linux bluetooth development
 help / color / mirror / Atom feed
From: Sathish Narsimman <nsathish41@gmail.com>
To: linux-bluetooth@vger.kernel.org, nsathish41@gmail.com
Cc: chethan.tumkur.narayan@intel.com,
	Sathish Narsimman <sathish.narasimman@intel.com>
Subject: [PATCH 7/7] Bluetooth LL Privacy update White list
Date: Thu, 12 Mar 2020 15:37:54 +0530	[thread overview]
Message-ID: <20200312100754.3445-8-sathish.narasimman@intel.com> (raw)
In-Reply-To: <20200312100754.3445-1-sathish.narasimman@intel.com>

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@intel.com>
---
 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


  parent reply	other threads:[~2020-03-12 10:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 10:07 [PATCH 0/7] LE LL Priavcy support enabled Sathish Narsimman
2020-03-12 10:07 ` [PATCH 1/7] Bluetooth: LL Privacy Delete Store Resolving list Sathish Narsimman
2020-03-18 10:42   ` Marcel Holtmann
2020-03-18 10:47     ` Sathish Narasimman
2020-03-12 10:07 ` [PATCH 2/7] Bluetooth: Add device to Resolving List Sathish Narsimman
2020-03-18  9:29   ` Szymon Janc
2020-03-18 10:29     ` Sathish Narasimman
2020-03-12 10:07 ` [PATCH 3/7] Bluetooth: Update the Resolving list when Local IRK changed Sathish Narsimman
2020-03-18 10:45   ` Marcel Holtmann
2020-03-12 10:07 ` [PATCH 4/7] Bluetooth: LL_PRIVACY re-load resolving list Sathish Narsimman
2020-03-18 11:06   ` Marcel Holtmann
2020-03-12 10:07 ` [PATCH 5/7] Bluetooth: LL Privacy Check and Update the Resolving List Sathish Narsimman
2020-03-12 10:07 ` [PATCH 6/7] Bluetooth: Enable LL Privacy Sathish Narsimman
2020-03-18 11:04   ` Marcel Holtmann
2020-03-12 10:07 ` Sathish Narsimman [this message]
2020-03-18  8:56 ` [PATCH 0/7] LE LL Priavcy support enabled Sathish Narasimman
2020-04-01 20:04   ` Abhishek Pandit-Subedi
2020-04-06 16:34     ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200312100754.3445-8-sathish.narasimman@intel.com \
    --to=nsathish41@gmail.com \
    --cc=chethan.tumkur.narayan@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=sathish.narasimman@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox