This is an automated email from the ASF dual-hosted git repository. janc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 4c113a93f887c7dfd7bb38df00937dee3b62a666 Author: Szymon Janc <[email protected]> AuthorDate: Tue Apr 22 16:31:10 2025 +0200 nimble/phy: Fix resolving list entry removal in nRF51 g_nrf_irk_list is array of uint32_t while IRKs are 4 words long so this needs to be accounted for. This was causing IRK corruption if entry removed was not the first entry in memory. --- nimble/drivers/nrf51/src/ble_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/drivers/nrf51/src/ble_hw.c b/nimble/drivers/nrf51/src/ble_hw.c index fb6e844b0..fc07506ef 100644 --- a/nimble/drivers/nrf51/src/ble_hw.c +++ b/nimble/drivers/nrf51/src/ble_hw.c @@ -452,7 +452,7 @@ ble_hw_resolv_list_rmv(int index) if (index < g_nrf_num_irks) { --g_nrf_num_irks; - irk_entry = &g_nrf_irk_list[index]; + irk_entry = &g_nrf_irk_list[4 * index]; if (g_nrf_num_irks > index) { memmove(irk_entry, irk_entry + 4, 16 * (g_nrf_num_irks - index)); }
