Skip to content

Commit 6540351

Browse files
committed
Bluetooth: Translate additional address type correctly
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. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Sathish Narsimman <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 58789a1 commit 6540351

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

include/net/bluetooth/hci.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,8 +2279,10 @@ struct hci_ev_le_conn_complete {
22792279
#define LE_EXT_ADV_SCAN_RSP 0x0008
22802280
#define LE_EXT_ADV_LEGACY_PDU 0x0010
22812281

2282-
#define ADDR_LE_DEV_PUBLIC 0x00
2283-
#define ADDR_LE_DEV_RANDOM 0x01
2282+
#define ADDR_LE_DEV_PUBLIC 0x00
2283+
#define ADDR_LE_DEV_RANDOM 0x01
2284+
#define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02
2285+
#define ADDR_LE_DEV_RANDOM_RESOLVED 0x03
22842286

22852287
#define HCI_EV_LE_ADVERTISING_REPORT 0x02
22862288
struct hci_ev_le_advertising_info {

net/bluetooth/hci_core.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,6 +3292,15 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list,
32923292
{
32933293
struct hci_conn_params *param;
32943294

3295+
switch (addr_type) {
3296+
case ADDR_LE_DEV_PUBLIC_RESOLVED:
3297+
addr_type = ADDR_LE_DEV_PUBLIC;
3298+
break;
3299+
case ADDR_LE_DEV_RANDOM_RESOLVED:
3300+
addr_type = ADDR_LE_DEV_RANDOM;
3301+
break;
3302+
}
3303+
32953304
list_for_each_entry(param, list, action) {
32963305
if (bacmp(&param->addr, addr) == 0 &&
32973306
param->addr_type == addr_type)

0 commit comments

Comments
 (0)