ble_mesh: Fix provisioning buffer initialization [Zephyr]
When PB-GATT support has been enabled the provisioning code "borrows" the buffer from the proxy code. However, the way that initialization was happening the proxy buffers were initialized only after provisioning initialization, resulting in a corrupted buffer with buf->data pointing to NULL. Reorder the initialization calls so that proxy is done first and provisioning only after it.
This commit is contained in:
parent
2c6a3f9e5b
commit
203f871420
1 changed files with 13 additions and 13 deletions
|
@ -334,6 +334,19 @@ int bt_mesh_init(const struct bt_mesh_prov *prov,
|
|||
bt_mesh_gatt_init();
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_PROXY)) {
|
||||
if ((IS_ENABLED(CONFIG_BLE_MESH_NODE) &&
|
||||
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) ||
|
||||
IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER)) {
|
||||
bt_mesh_proxy_init();
|
||||
}
|
||||
if ((IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) &&
|
||||
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) ||
|
||||
IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT)) {
|
||||
bt_mesh_proxy_prov_client_init();
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_PROV)) {
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_NODE)) {
|
||||
err = bt_mesh_prov_init(prov);
|
||||
|
@ -363,19 +376,6 @@ int bt_mesh_init(const struct bt_mesh_prov *prov,
|
|||
|
||||
bt_mesh_adv_init();
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_PROXY)) {
|
||||
if ((IS_ENABLED(CONFIG_BLE_MESH_NODE) &&
|
||||
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) ||
|
||||
IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER)) {
|
||||
bt_mesh_proxy_init();
|
||||
}
|
||||
if ((IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) &&
|
||||
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) ||
|
||||
IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT)) {
|
||||
bt_mesh_proxy_prov_client_init();
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER)) {
|
||||
bt_mesh_provisioner_init();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue