mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-07-27 13:27:47 +00:00
mesh: Fix checking for subnet when recovering App Key
The ordering of items in flash is not guaranteed, so it's possible we get an App Key before the corresponding Net Key. Remove the check for a Net Key, since the storing code should never store an App Key if there is no corresponding Net Key.
This commit is contained in:
@@ -380,7 +380,6 @@ static int net_key_set(int argc, char **argv, char *val)
|
||||
static int app_key_set(int argc, char **argv, char *val)
|
||||
{
|
||||
struct bt_mesh_app_key *app;
|
||||
struct bt_mesh_subnet *sub;
|
||||
struct app_key_val key;
|
||||
u16_t app_idx;
|
||||
int len, err;
|
||||
@@ -412,12 +411,6 @@ static int app_key_set(int argc, char **argv, char *val)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
sub = bt_mesh_subnet_get(key.net_idx);
|
||||
if (!sub) {
|
||||
BT_ERR("Failed to find subnet 0x%03x", key.net_idx);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
app = bt_mesh_app_key_find(app_idx);
|
||||
if (!app) {
|
||||
app = bt_mesh_app_key_alloc(app_idx);
|
||||
|
||||
Reference in New Issue
Block a user