Config Key Refresh Phase Status is 4 octets long (see Mesh Profile v1.0.1, section 4.3.2.60): 1 octet for status, 2 octets for net key index, 1 octet for the phase. --- mesh/cfgmod-server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c index 9da981700..90ebdf046 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -447,11 +447,11 @@ static uint16_t cfg_key_refresh_phase(struct mesh_node *node, done: msg[n] = status; - l_put_le16(idx, msg + n); - msg[n + 2] = (status != MESH_STATUS_SUCCESS) ? + l_put_le16(idx, &msg[n + 1]); + msg[n + 3] = (status != MESH_STATUS_SUCCESS) ? KEY_REFRESH_PHASE_NONE : phase; - return n + 3; + return n + 4; } static uint8_t uint32_to_log(uint32_t value) -- 2.20.1