From 06d445759a511557e13394ed4503790f45c7867b Mon Sep 17 00:00:00 2001 From: lly Date: Fri, 8 May 2020 20:05:02 +0800 Subject: [PATCH] ble_mesh: net_key_status only pull one key idx [Zephyr] Fixes bug where the config client's net_key_status handler would attempt to pull two key indexes from a message which only holds one. --- components/bt/esp_ble_mesh/mesh_core/cfg_cli.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/bt/esp_ble_mesh/mesh_core/cfg_cli.c b/components/bt/esp_ble_mesh/mesh_core/cfg_cli.c index cff21099a..3138079fd 100644 --- a/components/bt/esp_ble_mesh/mesh_core/cfg_cli.c +++ b/components/bt/esp_ble_mesh/mesh_core/cfg_cli.c @@ -341,14 +341,13 @@ static void net_key_status(struct bt_mesh_model *model, struct net_buf_simple *buf) { struct bt_mesh_cfg_netkey_status status = {0}; - u16_t app_idx = 0U; BT_DBG("net_idx 0x%04x app_idx 0x%04x src 0x%04x len %u: %s", ctx->net_idx, ctx->app_idx, ctx->addr, buf->len, bt_hex(buf->data, buf->len)); status.status = net_buf_simple_pull_u8(buf); - key_idx_unpack(buf, &status.net_idx, &app_idx); + status.net_idx = net_buf_simple_pull_le16(buf) & 0xfff; cfg_client_cancel(model, ctx, &status, sizeof(struct bt_mesh_cfg_netkey_status)); }