Skip to content

Commit d4b0be4

Browse files
committed
host: reset privacy state when resetting
Without this fix, ble_hs_reset() left the privacy module's cached IRK and started flag intact, so the next ble_hs_sync()'s call to ble_hs_pvcy_set_our_irk() short-circuited on the unchanged IRK and skipped re-enabling resolution plus rebuilding the resolving list. The controller had cleared both on its side, so RPA-based reconnects after a host reset came in unresolved and the host couldn't match them to bonded peers. Mirror what ble_hs_stop() already does and call ble_hs_pvcy_reset() from ble_hs_reset() so the next set_our_irk() does the full clear/enable/add sequence, matching the first-boot path. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
1 parent 8fbcc2f commit d4b0be4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

nimble/host/src/ble_hs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ ble_hs_reset(void)
375375
/* Clear configured addresses. */
376376
ble_hs_id_reset();
377377

378+
/* Drop cached privacy state so sync re-runs the full setup. */
379+
ble_hs_pvcy_reset();
380+
378381
if (ble_hs_cfg.reset_cb != NULL && ble_hs_reset_reason != 0) {
379382
ble_hs_cfg.reset_cb(ble_hs_reset_reason);
380383
}

0 commit comments

Comments
 (0)