Explorar o código

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.
lly %!s(int64=5) %!d(string=hai) anos
pai
achega
97f11600e3
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      components/bt/esp_ble_mesh/mesh_core/cfg_cli.c

+ 1 - 2
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));
 }