All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Fix re-setting RPA as expired when deferring update
@ 2014-09-12 16:31 johan.hedberg
  2014-09-12 16:36 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: johan.hedberg @ 2014-09-12 16:31 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

The hci_update_random_address will clear the RPA_EXPIRED flag and
proceed with setting a new one if the flag was set. However, the
set_random_addr() function that is called may choose to defer the update
to a later moment. In such a case the flag would incorrectly remain
unset unless set_random_addr() re-sets it. This patch fixes the issue.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/hci_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 0d3782ad9a5b..067526d9680d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3872,6 +3872,7 @@ static void set_random_addr(struct hci_request *req, bdaddr_t *rpa)
 	if (test_bit(HCI_LE_ADV, &hdev->dev_flags) ||
 	    hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT)) {
 		BT_DBG("Deferring random address update");
+		set_bit(HCI_RPA_EXPIRED, &hdev->dev_flags);
 		return;
 	}
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Fix re-setting RPA as expired when deferring update
  2014-09-12 16:31 [PATCH] Bluetooth: Fix re-setting RPA as expired when deferring update johan.hedberg
@ 2014-09-12 16:36 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2014-09-12 16:36 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: linux-bluetooth

Hi Johan,

> The hci_update_random_address will clear the RPA_EXPIRED flag and
> proceed with setting a new one if the flag was set. However, the
> set_random_addr() function that is called may choose to defer the update
> to a later moment. In such a case the flag would incorrectly remain
> unset unless set_random_addr() re-sets it. This patch fixes the issue.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/hci_core.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-12 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12 16:31 [PATCH] Bluetooth: Fix re-setting RPA as expired when deferring update johan.hedberg
2014-09-12 16:36 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.