Skip to content

Commit

Permalink
Bluetooth: Handle own address type change with HCI_ENABLE_LL_PRIVACY
Browse files Browse the repository at this point in the history
own_address_type has to changed to 0x02 and 0x03 only when
HCI_ENABLE_LL_PRIVACY flag is set.

Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Sathish Narasimman authored and Marcel Holtmann committed Apr 6, 2021
1 parent b6f1b79 commit abb638b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/bluetooth/hci_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,8 @@ int hci_get_random_address(struct hci_dev *hdev, bool require_privacy,
/* If Controller supports LL Privacy use own address type is
* 0x03
*/
if (use_ll_privacy(hdev))
if (use_ll_privacy(hdev) &&
hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY))
*own_addr_type = ADDR_LE_DEV_RANDOM_RESOLVED;
else
*own_addr_type = ADDR_LE_DEV_RANDOM;
Expand Down Expand Up @@ -2517,7 +2518,8 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy,
/* If Controller supports LL Privacy use own address type is
* 0x03
*/
if (use_ll_privacy(hdev))
if (use_ll_privacy(hdev) &&
hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY))
*own_addr_type = ADDR_LE_DEV_RANDOM_RESOLVED;
else
*own_addr_type = ADDR_LE_DEV_RANDOM;
Expand Down

0 comments on commit abb638b

Please sign in to comment.