From 2716bf93885ae07610d7f2c5ccc29658cd8c61d8 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Mon, 13 Oct 2025 16:15:20 +0200 Subject: [PATCH 1/2] Bluetooth: Mesh: Provisioner closes link on failed According to MshPrt 5.4.4, The Provisioner, upon receiving the Provisioning Failed PDU, shall assume that the provisioning failed and immediately disconnect the provisioning bearer. Signed-off-by: Ludvig Jordet --- subsys/bluetooth/mesh/provisioner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/provisioner.c b/subsys/bluetooth/mesh/provisioner.c index b1df6431d0682..353cde6b673a1 100644 --- a/subsys/bluetooth/mesh/provisioner.c +++ b/subsys/bluetooth/mesh/provisioner.c @@ -685,7 +685,7 @@ static void prov_confirm(const uint8_t *data) static void prov_failed(const uint8_t *data) { LOG_WRN("Error: 0x%02x", data[0]); - reset_state(); + prov_link_close(PROV_BEARER_LINK_STATUS_FAIL); } static void local_input_complete(void) From a93a15a8b85e8e30b492102b5174107d4418d699 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Tue, 14 Oct 2025 09:46:14 +0200 Subject: [PATCH 2/2] Bluetooth: Mesh: Minor cleanup of prov link close on success Changes the link close upon success to use the `prov_link_close` helper function instead of doing it manually, as minor cleanup. Signed-off-by: Ludvig Jordet --- subsys/bluetooth/mesh/provisioner.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/provisioner.c b/subsys/bluetooth/mesh/provisioner.c index 353cde6b673a1..28372caf45544 100644 --- a/subsys/bluetooth/mesh/provisioner.c +++ b/subsys/bluetooth/mesh/provisioner.c @@ -577,10 +577,9 @@ static void prov_complete(const uint8_t *data) bt_hex(&provisionee.new_dev_key, 16), node->net_idx, node->num_elem, node->addr); - bt_mesh_prov_link.expect = PROV_NO_PDU; atomic_set_bit(bt_mesh_prov_link.flags, COMPLETE); - bt_mesh_prov_link.bearer->link_close(PROV_BEARER_LINK_STATUS_SUCCESS); + prov_link_close(PROV_BEARER_LINK_STATUS_SUCCESS); } static void prov_node_add(void)