mesh: Allow deleting non-existing app key
authorMichał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Thu, 6 Aug 2020 14:13:09 +0000 (16:13 +0200)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Mon, 28 Dec 2020 06:20:04 +0000 (11:50 +0530)
Mesh Profile v1.0.1, section 4.3.2.40 Config AppKey Status

(...) The Status Code shall be Success if the received request was
redundant (add of an identical existing key, update of an identical
updated key, or delete of a non-existent key), with no further action
taken.

Change-Id: Ib85ca021261c77b49a5d9d6bc3ee7f2955e8b9b5
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
mesh/appkey.c

index 74ee32d..f19f46f 100644 (file)
@@ -319,7 +319,7 @@ int appkey_key_delete(struct mesh_net *net, uint16_t net_idx,
        key = l_queue_find(app_keys, match_key_index, L_UINT_TO_PTR(app_idx));
 
        if (!key)
-               return MESH_STATUS_INVALID_APPKEY;
+               return MESH_STATUS_SUCCESS;
 
        if (key->net_idx != net_idx)
                return MESH_STATUS_INVALID_NETKEY;