Bluetooth: host: Update id.c to support id rst/del for CONFIG_BT_SMP=n

Currently calls to these two functions fail unnecessarily when
CONFIG_BT_SMP is disabled. This fix allows identity resets
without having the BT_SMP stack enabled. The primary use case
is enabling random mac address rotation for privacy in memory
constrained SOCs. Fixes #73313

Signed-off-by: Patrick Patel <ppatel@micro-design.com>
This commit is contained in:
Patrick Patel 2024-05-28 06:35:39 +08:00 committed by David Leach
commit 131a0fad04

View file

@ -1415,7 +1415,7 @@ int bt_id_reset(uint8_t id, bt_addr_le_t *addr, uint8_t *irk)
}
}
if (IS_ENABLED(CONFIG_BT_CONN) &&
if (IS_ENABLED(CONFIG_BT_SMP) &&
!bt_addr_le_eq(&bt_dev.id_addr[id], BT_ADDR_LE_ANY)) {
err = bt_unpair(id, NULL);
if (err) {
@ -1453,7 +1453,7 @@ int bt_id_delete(uint8_t id)
}
}
if (IS_ENABLED(CONFIG_BT_CONN)) {
if (IS_ENABLED(CONFIG_BT_SMP)) {
int err;
err = bt_unpair(id, NULL);