You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2021/11/02 11:54:56 UTC
[mynewt-nimble] 01/09: nimble/ll: Fix marking AdvA as resolved when
restoring addrd
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit f75ccfca9a25793de82a552abb13a0ce65b4d37f
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Sun Oct 17 13:09:40 2021 +0200
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.
---
nimble/controller/src/ble_ll_scan.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c
index 9b12362..4fdf0f6 100644
--- a/nimble/controller/src/ble_ll_scan.c
+++ b/nimble/controller/src/ble_ll_scan.c
@@ -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
}