Skip to content

Commit b31bc00

Browse files
nsathish41holtmann
authored andcommitted
Bluetooth: Translate additional address type during le_conn
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 types. This patch is specially during LE_CREATE_CONN if using own_add_type as 0x02 or 0x03. Signed-off-by: Sathish Narasimman <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 0eee35b commit b31bc00

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

net/bluetooth/hci_event.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,6 +2296,22 @@ static void cs_le_create_conn(struct hci_dev *hdev, bdaddr_t *peer_addr,
22962296
if (!conn)
22972297
return;
22982298

2299+
/* When using controller based address resolution, then the new
2300+
* address types 0x02 and 0x03 are used. These types need to be
2301+
* converted back into either public address or random address type
2302+
*/
2303+
if (use_ll_privacy(hdev) &&
2304+
hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION)) {
2305+
switch (own_address_type) {
2306+
case ADDR_LE_DEV_PUBLIC_RESOLVED:
2307+
own_address_type = ADDR_LE_DEV_PUBLIC;
2308+
break;
2309+
case ADDR_LE_DEV_RANDOM_RESOLVED:
2310+
own_address_type = ADDR_LE_DEV_RANDOM;
2311+
break;
2312+
}
2313+
}
2314+
22992315
/* Store the initiator and responder address information which
23002316
* is needed for SMP. These values will not change during the
23012317
* lifetime of the connection.

0 commit comments

Comments
 (0)