diff mbox series

[1/1] mesh: Handle KeyRefresh phase set to 3

Message ID 1585078044-14974-6-git-send-email-prathyusha.n@samsung.com (mailing list archive)
State Superseded
Delegated to: Brian Gix
Headers show
Series [1/1] mesh: Handle KeyRefresh phase set to 3 | expand

Commit Message

Prathyusha Nelluri March 24, 2020, 7:27 p.m. UTC
From: Prathyusha N <prathyusha.n@samsung.com>

If keyRefresh phase 3 is already completed then respond with
current phase state and status as SUCCESS.
---
 mesh/net.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/mesh/net.c b/mesh/net.c
index ec05b6be9..91d14b0b3 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -3419,6 +3419,9 @@  uint8_t mesh_net_key_refresh_phase_set(struct mesh_net *net, uint16_t idx,
 	if (transition == subnet->kr_phase)
 		return MESH_STATUS_SUCCESS;
 
+	if (transition == 3 && subnet->kr_phase == KEY_REFRESH_PHASE_NONE)
+		return MESH_STATUS_SUCCESS;
+
 	if ((transition != 2 && transition != 3) ||
 						transition < subnet->kr_phase)
 		return MESH_STATUS_CANNOT_SET;