From 131a0fad0483e7b1cfe7535f4e666ebcd39ea427 Mon Sep 17 00:00:00 2001 From: Patrick Patel Date: Tue, 28 May 2024 06:35:39 +0800 Subject: [PATCH] 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 --- subsys/bluetooth/host/id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 38263e1cb2a..5b321da3622 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -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);