mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-30 15:32:41 +00:00
mesh: respond with Invalid NetKey on AppKey Add that already exists but with different NetKey
This commit is contained in:
parent
beed9d444e
commit
a025147c99
@ -1573,7 +1573,10 @@ static void config_appkey_add_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu
|
||||
mesh_transport_key_t * transport_key = mesh_transport_key_get(appkey_index);
|
||||
if (transport_key){
|
||||
uint8_t status;
|
||||
if (memcmp(transport_key->key, appkey, 16) == 0){
|
||||
if (transport_key->netkey_index != netkey_index){
|
||||
// already stored but with different netkey
|
||||
status = MESH_FOUNDATION_STATUS_INVALID_NETKEY_INDEX;
|
||||
} else if (memcmp(transport_key->key, appkey, 16) == 0 && transport_key->netkey_index == netkey_index){
|
||||
// key identical
|
||||
status = MESH_FOUNDATION_STATUS_SUCCESS;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user