Skip to content

Commit

Permalink
Bluetooth: Translate additional address type during le_conn_comp
Browse files Browse the repository at this point in the history
When using controller based address resolution, then the destination
address type during le_conn_complete uses 0x02 & 0x03 if controller
resolves the destination address(RPA).
These address types need to be converted back into either 0x00 0r 0x01

Signed-off-by: Sathish Narasimman <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
sathishnarasimman authored and holtmann committed Jun 26, 2021
1 parent c615943 commit 79699a7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -5196,6 +5196,23 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
conn->dst_type = irk->addr_type;
}

/* When using controller based address resolution, then the new
* address types 0x02 and 0x03 are used. These types need to be
* converted back into either public address or random address type
*/
if (use_ll_privacy(hdev) &&
hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) &&
hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION)) {
switch (conn->dst_type) {
case ADDR_LE_DEV_PUBLIC_RESOLVED:
conn->dst_type = ADDR_LE_DEV_PUBLIC;
break;
case ADDR_LE_DEV_RANDOM_RESOLVED:
conn->dst_type = ADDR_LE_DEV_RANDOM;
break;
}
}

if (status) {
hci_le_conn_failed(conn, status);
goto unlock;
Expand Down

0 comments on commit 79699a7

Please sign in to comment.