Skip to content

Commit 79699a7

Browse files
sathishnarasimmanholtmann
authored andcommitted
Bluetooth: Translate additional address type during le_conn_comp
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]>
1 parent c615943 commit 79699a7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

net/bluetooth/hci_event.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5196,6 +5196,23 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
51965196
conn->dst_type = irk->addr_type;
51975197
}
51985198

5199+
/* When using controller based address resolution, then the new
5200+
* address types 0x02 and 0x03 are used. These types need to be
5201+
* converted back into either public address or random address type
5202+
*/
5203+
if (use_ll_privacy(hdev) &&
5204+
hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) &&
5205+
hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION)) {
5206+
switch (conn->dst_type) {
5207+
case ADDR_LE_DEV_PUBLIC_RESOLVED:
5208+
conn->dst_type = ADDR_LE_DEV_PUBLIC;
5209+
break;
5210+
case ADDR_LE_DEV_RANDOM_RESOLVED:
5211+
conn->dst_type = ADDR_LE_DEV_RANDOM;
5212+
break;
5213+
}
5214+
}
5215+
51995216
if (status) {
52005217
hci_le_conn_failed(conn, status);
52015218
goto unlock;

0 commit comments

Comments
 (0)