Skip to content

Commit 6056397

Browse files
tsvehagenjhedberg
authored andcommitted
Bluetooth: Mesh: Fix handling of app index and local device key
Fix problem of not checking if the remote device key is actually our own. This bug was intruduced in 46a95f1 and causes failure of models that use app_idx BT_MESH_KEY_DEV_REMOTE. Since this is used by cfg_cli, it was not possible to do self-configuration. Signed-off-by: Tobias Svehagen <[email protected]>
1 parent 2ac3a85 commit 6056397

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/bluetooth/mesh/transport.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,9 @@ int bt_mesh_app_key_get(const struct bt_mesh_subnet *subnet, u16_t app_idx,
17171717
{
17181718
struct bt_mesh_app_key *app_key;
17191719

1720-
if (app_idx == BT_MESH_KEY_DEV_LOCAL) {
1720+
if (app_idx == BT_MESH_KEY_DEV_LOCAL ||
1721+
(app_idx == BT_MESH_KEY_DEV_REMOTE &&
1722+
bt_mesh_elem_find(addr) != NULL)) {
17211723
*aid = 0;
17221724
*key = bt_mesh.dev_key;
17231725
return 0;

0 commit comments

Comments
 (0)