Skip to content

Commit 8709818

Browse files
Andrewpinijukkar
authored andcommitted
[nrf noup] Bluetooth: Mesh: Fix adv randomness bug
Fixes issue where randomness can be removed for advertising sets that have to handle other adv types than the BT_MESH_FRIEND_ADV tag type. Signed-off-by: Anders Storrø <[email protected]> Signed-off-by: Aleksandr Khromykh <[email protected]> Signed-off-by: Dominik Ermel <[email protected]> (cherry picked from commit 3a212a5) (cherry picked from commit d46f2ee)
1 parent 6d82661 commit 8709818

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

subsys/bluetooth/mesh/adv_ext.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,10 @@ int bt_mesh_adv_enable(void)
522522
return err;
523523
}
524524

525-
if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) {
526-
err = set_adv_randomness(adv->instance->handle, 0);
525+
if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) &&
526+
IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_FRIEND_SEPARATE) &&
527+
advs[i].tags == BT_MESH_ADV_TAG_BIT_FRIEND) {
528+
err = set_adv_randomness(advs[i].instance->handle, 0);
527529
if (err) {
528530
LOG_ERR("Failed to set zero randomness: %d", err);
529531
}

0 commit comments

Comments
 (0)