Bluetooth: Mesh: Release previously reserved slot before reserving again

If the previous upload was in-band and it didn't complete, the slot will
stay reserved. By design we release slot not at the end of the upload
phase, but at the start of a new upload phase.

This fixes DFU/SR/FD/BV-13-C.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
Pavel Vasilyev 2023-10-10 07:57:32 +02:00 committed by Johan Hedberg
commit d1c2ca2525

View file

@ -607,6 +607,13 @@ static int handle_upload_start_oob(struct bt_mesh_model *mod, struct bt_mesh_msg
return 0;
}
/* This will be a no-op if the slot state isn't RESERVED, which is
* what we want.
*/
if (srv->upload.slot) {
bt_mesh_dfu_slot_release(srv->upload.slot);
}
srv->upload.is_oob = true;
srv->upload.slot = slot;
memcpy(srv->upload.oob.uri, uri, uri_len);