Bluetooth: Fix using NRPA for connectable advertising
If privacy is disabled and static random address is used for identity we need to restore static address before enabling advertising. Otherwise NRPA used for any previous active scan could be used instead. Change-Id: Ifea0d2863d78060c84e61d89ef384a94e86895b6 Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
parent
a3488d13e0
commit
48eee87a39
1 changed files with 9 additions and 0 deletions
|
@ -3534,6 +3534,15 @@ int bt_le_adv_start(const struct bt_le_adv_param *param,
|
|||
|
||||
set_param->own_addr_type = BT_ADDR_LE_RANDOM;
|
||||
#else
|
||||
/*
|
||||
* If Static Random address is used as Identity address we need
|
||||
* to restore it before advertising is enabled. Otherwise NRPA
|
||||
* used for active scan could be used for advertising.
|
||||
*/
|
||||
if (atomic_test_bit(bt_dev.flags, BT_DEV_ID_STATIC_RANDOM)) {
|
||||
set_random_address(&bt_dev.id_addr.a);
|
||||
}
|
||||
|
||||
set_param->own_addr_type = bt_dev.id_addr.type;
|
||||
#endif /* CONFIG_BLUETOOTH_PRIVACY */
|
||||
set_param->type = BT_LE_ADV_IND;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue