Bluetooth: controller: Add privacy handling for LE Scan Request Recv
Scanner address returned in event should be resolved, if possible. Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This commit is contained in:
parent
bca3560100
commit
3006dac9ae
3 changed files with 27 additions and 3 deletions
|
@ -3747,6 +3747,9 @@ static void le_scan_req_received(struct pdu_data *pdu_data,
|
|||
struct pdu_adv *adv = (void *)pdu_data;
|
||||
struct bt_hci_evt_le_scan_req_received *sep;
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_PRIVACY)
|
||||
uint8_t rl_idx;
|
||||
#endif
|
||||
|
||||
if (!(event_mask & BT_EVT_MASK_LE_META_EVENT) ||
|
||||
!(le_event_mask & BT_EVT_MASK_LE_SCAN_REQ_RECEIVED)) {
|
||||
|
@ -3773,6 +3776,23 @@ static void le_scan_req_received(struct pdu_data *pdu_data,
|
|||
sep->addr.type = adv->tx_addr;
|
||||
memcpy(&sep->addr.a.val[0], &adv->scan_req.scan_addr[0],
|
||||
sizeof(bt_addr_t));
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_PRIVACY)
|
||||
rl_idx = node_rx->hdr.rx_ftr.rl_idx;
|
||||
if (rl_idx < ll_rl_size_get()) {
|
||||
/* Store identity address */
|
||||
ll_rl_id_addr_get(rl_idx, &sep->addr.type,
|
||||
&sep->addr.a.val[0]);
|
||||
/* Mark it as identity address from RPA (0x02, 0x03) */
|
||||
sep->addr.type += 2U;
|
||||
} else {
|
||||
#else
|
||||
if (1) {
|
||||
#endif
|
||||
sep->addr.type = adv->tx_addr;
|
||||
memcpy(&sep->addr.a.val[0], &adv->adv_ind.addr[0],
|
||||
sizeof(bt_addr_t));
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_BT_CTLR_SCAN_REQ_NOTIFY */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue