mesh: A NetKey shall not be deleted from the NetKey List using a message secured with this NetKey

This commit is contained in:
Matthias Ringwald 2019-07-04 14:12:30 +02:00
parent 2951b4690d
commit 84339629f0

View File

@ -943,7 +943,8 @@ static void config_netkey_delete_handler(mesh_model_t * mesh_model, mesh_pdu_t *
// remove subnet
mesh_subnet_t * subnet = mesh_subnet_get_by_netkey_index(netkey_index);
if (subnet != NULL){
if (mesh_subnet_list_count() > 1){
// A NetKey shall not be deleted from the NetKey List using a message secured with this NetKey.
if (mesh_subnet_list_count() > 1 && subnet->netkey_index != netkey_index){
// remove all appkeys for this netkey
mesh_transport_key_iterator_t it;