nimble/ll: Fix marking AdvA as resolved when restoring addrd
AdvA was resolved only if corresponding flag is set. It's possible to
have rpa_index>0 and not resolved AdvA in case AdvA was an identity
address but it was added to rl.
@@ -2439,14 +2439,19 @@ ble_ll_scan_rx_pkt_in_restore_addr_data(struct ble_mbuf_hdr *hdr,
addrd->adv_addr_type = addrd->adva_type;
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)
- if (rxinfo->rpa_index >= 0) {
+ addrd->rpa_index = rxinfo->rpa_index;
+
+ if (hdr->rxinfo.flags & BLE_MBUF_HDR_F_RESOLVED) {
+ BLE_LL_ASSERT(rxinfo->rpa_index >= 0);
rl = &g_ble_ll_resolv_list[rxinfo->rpa_index];
addrd->adv_addr = rl->rl_identity_addr;
addrd->adv_addr_type = rl->rl_addr_type;
+ addrd->adva_resolved = 1;
}
if (hdr->rxinfo.flags & BLE_MBUF_HDR_F_TARGETA_RESOLVED) {
addrd->targeta = ble_ll_get_our_devaddr(scansm->own_addr_type & 1);
addrd->targeta_type = scansm->own_addr_type & 1;
+ addrd->targeta_resolved = 1;
}
#endif
}
