bluetooth: id: fix uninitialized RPA for non-default identities

This change fixes uninitialized RPA values for advertising sets of
non-default Bluetooth identities. The regression has been introduced
in the following commit:

8d6b206064

The follow-up fix for the default Bluetooth identity has been
introduced in a separate commit:

88c20b9cdd

Non-default Bluetooth identities can be loaded from the Settings
subsystem. In this case, RPAs of related advertising sets to these
identities are left uninitialized as the bt_id_create() function
context is not executed. As a result, the RPA is not created for
advertising sets of non-default Bluetooth identities, and the
advertising is started with the 00:00:00:00:00:00 address.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This commit is contained in:
Kamil Piszczek 2023-10-26 13:24:13 +02:00 committed by Fabio Baltieri
parent 5fc7304878
commit 29a67338d1

View File

@ -2064,7 +2064,9 @@ int bt_id_init(void)
int err;
#if defined(CONFIG_BT_PRIVACY)
bt_addr_copy(&bt_dev.rpa[BT_ID_DEFAULT], BT_ADDR_NONE);
for (uint8_t id = 0U; id < ARRAY_SIZE(bt_dev.rpa); id++) {
bt_addr_copy(&bt_dev.rpa[id], BT_ADDR_NONE);
}
k_work_init_delayable(&bt_dev.rpa_update, rpa_timeout);
#endif