[PATCH BlueZ 3/3] mesh: Return correct error code for AppKey List command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If AppKey List command is called with a network key index that
is not valid for the node, return Invalid NetKey Index error code
---
 mesh/appkey.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mesh/appkey.c b/mesh/appkey.c
index f799b7782..3cc1e4f0b 100644
--- a/mesh/appkey.c
+++ b/mesh/appkey.c
@@ -506,6 +506,9 @@ uint8_t appkey_list(struct mesh_net *net, uint16_t net_idx, uint8_t *buf,
 
 	*size = 0;
 
+	if (!mesh_net_have_key(net, net_idx))
+		return MESH_STATUS_INVALID_NETKEY;
+
 	app_keys = mesh_net_get_app_keys(net);
 	if (!app_keys || l_queue_isempty(app_keys))
 		return MESH_STATUS_SUCCESS;
-- 
2.17.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux