mesh: Update Key Refresh flag after provision
authorIsak Westin <isak.westin@loytec.com>
Thu, 6 Oct 2022 14:59:22 +0000 (16:59 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:55 +0000 (14:55 +0530)
The Key Refresh flag in the Secure Network beacon is now correctly
updated based on provisioning data after being successfully provisioned.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
mesh/node.c

index f00a877..a2c8254 100644 (file)
@@ -1287,8 +1287,8 @@ static bool add_local_node(struct mesh_node *node, uint16_t unicast, bool kr,
                                                        MESH_STATUS_SUCCESS)
                        return false;
 
-               if (!mesh_config_net_key_set_phase(node->cfg, net_key_idx,
-                                                       KEY_REFRESH_PHASE_TWO))
+               if (mesh_net_key_refresh_phase_set(node->net, net_key_idx,
+                               KEY_REFRESH_PHASE_TWO) != MESH_STATUS_SUCCESS)
                        return false;
        }