diff mbox series

[BlueZ] mesh: Allow deleting non-existing app key

Message ID 20200806141309.26007-1-michal.lowas-rzechonek@silvair.com (mailing list archive)
State Accepted
Headers show
Series [BlueZ] mesh: Allow deleting non-existing app key | expand

Commit Message

Michał Lowas-Rzechonek Aug. 6, 2020, 2:13 p.m. UTC
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.
---
 mesh/appkey.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brian Gix Aug. 6, 2020, 10:47 p.m. UTC | #1
Applied
On Thu, 2020-08-06 at 16:13 +0200, Michał Lowas-Rzechonek wrote:
> 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.
> ---
>  mesh/appkey.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mesh/appkey.c b/mesh/appkey.c
> index 45d604007..a4771bd7d 100644
> --- a/mesh/appkey.c
> +++ b/mesh/appkey.c
> @@ -320,7 +320,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;
diff mbox series

Patch

diff --git a/mesh/appkey.c b/mesh/appkey.c
index 45d604007..a4771bd7d 100644
--- a/mesh/appkey.c
+++ b/mesh/appkey.c
@@ -320,7 +320,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;