Segmentation fault was caused by passing subnet pointer to the start_network_beacon() which was NULL --- mesh/net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesh/net.c b/mesh/net.c index c7aff9ab4..87a861bf0 100644 --- a/mesh/net.c +++ b/mesh/net.c @@ -1017,6 +1017,8 @@ int mesh_net_add_key(struct mesh_net *net, uint16_t idx, const uint8_t *value) return MESH_STATUS_SUCCESS; else return MESH_STATUS_IDX_ALREADY_STORED; + } else { + subnet = subnet_new(net, idx); } status = add_key(net, idx, value); @@ -2490,7 +2492,7 @@ static void net_rx(void *net_ptr, void *user_data) int8_t rssi = 0; key_id = net_key_decrypt(net->iv_index, data->data, data->len, - &out, &out_size); + &out, &out_size); if (!key_id) return; -- 2.20.1