Skip to content

Commit 20a48ad

Browse files
alxelaxm-alperen-sener
authored andcommitted
[nrf fromtree] Bluetooth: Mesh: remove double cdb node storing
Commit removes the double cdb node entry storing into the settings if device was reprovisioned over nppi interface. Signed-off-by: Aleksandr Khromykh <[email protected]> (cherry picked from commit 4bb5957)
1 parent 471639b commit 20a48ad

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

subsys/bluetooth/mesh/provisioner.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -589,18 +589,16 @@ static void prov_node_add(void)
589589
struct bt_mesh_cdb_node *node = provisionee.node;
590590
int err;
591591

592-
if (atomic_test_bit(bt_mesh_prov_link.flags, REPROVISION)) {
593-
bt_mesh_cdb_node_update(node, bt_mesh_prov_link.addr,
594-
provisionee.elem_count);
595-
}
596-
597592
err = bt_mesh_cdb_node_key_import(node, provisionee.new_dev_key);
598593
if (err) {
599594
LOG_ERR("Failed to import node device key");
600595
return;
601596
}
602597

603-
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
598+
if (atomic_test_bit(bt_mesh_prov_link.flags, REPROVISION)) {
599+
bt_mesh_cdb_node_update(node, bt_mesh_prov_link.addr,
600+
provisionee.elem_count);
601+
} else if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
604602
bt_mesh_cdb_node_store(node);
605603
}
606604

0 commit comments

Comments
 (0)