linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Narasimman, Sathish" <sathish.narasimman@intel.com>
To: Sathish Narasimman <nsathish41@gmail.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"Narasimman, Sathish" <sathish.narasimman@intel.com>
Cc: "Tumkur Narayan, Chethan" <chethan.tumkur.narayan@intel.com>,
	"Srivatsa, Ravishankar" <ravishankar.srivatsa@intel.com>,
	"K, Kiran" <kiran.k@intel.com>
Subject: RE: [PATCH] Bluetooth: Fix: LL PRivacy BLE device fails to connect
Date: Tue, 3 Nov 2020 02:05:03 +0000	[thread overview]
Message-ID: <SN6PR11MB27030B1A75144BAAD0AF247294110@SN6PR11MB2703.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201029074821.29950-1-sathish.narasimman@intel.com>

Hi

> -----Original Message-----
> From: Sathish Narasimman <nsathish41@gmail.com>
> Sent: Thursday, October 29, 2020 1:18 PM
> To: linux-bluetooth@vger.kernel.org
> Cc: Tumkur Narayan, Chethan <chethan.tumkur.narayan@intel.com>;
> Srivatsa, Ravishankar <ravishankar.srivatsa@intel.com>; K, Kiran
> <kiran.k@intel.com>; Narasimman, Sathish
> <sathish.narasimman@intel.com>
> Subject: [PATCH] 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: 0eee35bdfa3b ("Bluetooth: Update resolving list when updating
> whitelist")
> 
> Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
> ---
>  net/bluetooth/hci_request.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index
> 6f12bab4d2fa..610ed0817bd7 100644
> --- a/net/bluetooth/hci_request.c
> +++ b/net/bluetooth/hci_request.c
> @@ -698,7 +698,8 @@ static void del_from_white_list(struct hci_request
> *req, bdaddr_t *bdaddr,
>  		   cp.bdaddr_type);
>  	hci_req_add(req, HCI_OP_LE_DEL_FROM_WHITE_LIST, sizeof(cp),
> &cp);
> 
> -	if (use_ll_privacy(req->hdev)) {
> +	if (use_ll_privacy(req->hdev) &&
> +	    hci_dev_test_flag(req->hdev, HCI_ENABLE_LL_PRIVACY)) {
>  		struct smp_irk *irk;
> 
>  		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,
>  		return -1;
> 
>  	/* White list can not be used with RPAs */
> -	if (!allow_rpa && !use_ll_privacy(hdev) &&
> +	if (!allow_rpa &&
> +	    !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) &&
>  	    hci_find_irk_by_addr(hdev, &params->addr, params->addr_type))
> {
>  		return -1;
>  	}
> @@ -750,7 +752,8 @@ static int add_to_white_list(struct hci_request *req,
>  		   cp.bdaddr_type);
>  	hci_req_add(req, HCI_OP_LE_ADD_TO_WHITE_LIST, sizeof(cp), &cp);
> 
> -	if (use_ll_privacy(hdev)) {
> +	if (use_ll_privacy(hdev) &&
> +	    hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY)) {
>  		struct smp_irk *irk;
> 
>  		irk = hci_find_irk_by_addr(hdev, &params->addr, @@ -812,7
> +815,8 @@ static u8 update_white_list(struct hci_request *req)
>  		}
> 
>  		/* White list can not be used with RPAs */
> -		if (!allow_rpa && !use_ll_privacy(hdev) &&
> +		if (!allow_rpa &&
> +		    !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) &&
>  		    hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type))
> {
>  			return 0x00;
>  		}
> --
> 2.17.1

Gentle Reminder

Regards
Sathish N


  reply	other threads:[~2020-11-03  2:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29  7:48 [PATCH] Bluetooth: Fix: LL PRivacy BLE device fails to connect Sathish Narasimman
2020-11-03  2:05 ` Narasimman, Sathish [this message]
2020-11-09 12:41 ` Marcel Holtmann
2020-12-26 17:02   ` Kan-Ru Chen
  -- strict thread matches above, loose matches on Subject: below --
2020-10-22  8:23 Sathish Narasimman
2020-10-28  5:30 ` Sathish Narasimman
2020-10-29  0:22   ` Luiz Augusto von Dentz
2020-10-29  7:27     ` Narasimman, Sathish
2020-10-29  0:20 ` Luiz Augusto von Dentz

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=SN6PR11MB27030B1A75144BAAD0AF247294110@SN6PR11MB2703.namprd11.prod.outlook.com \
    --to=sathish.narasimman@intel.com \
    --cc=chethan.tumkur.narayan@intel.com \
    --cc=kiran.k@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=nsathish41@gmail.com \
    --cc=ravishankar.srivatsa@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;
as well as URLs for NNTP newsgroup(s).