Skip to content

Commit

Permalink
[nrf fromtree] Bluetooth: Mesh: Fix uninitialized field when cancelli…
Browse files Browse the repository at this point in the history
…ng transfer blob

Initialize the missing chunk field when canceling a BLOB Transfer.
If you canceled a BLOB Transfer, the missing_chunk was not cleared in
the next BLOB Transfer. This can make it look like there are still
missing chunks, even though all chunks in the block have already been
received, and it does cause bugs.

Signed-off-by: Junho Lee <tot0roprog@gmail.com>
(cherry picked from commit 327acfb05b368c104ee70b81da92e7cf7a9265f5)
  • Loading branch information
tot0rokr authored and nordicjm committed Aug 27, 2024
1 parent 84f0ff8 commit 5f4236e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions subsys/bluetooth/mesh/blob_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ static void cancel(struct bt_mesh_blob_srv *srv)
srv->state.xfer.mode = BT_MESH_BLOB_XFER_MODE_NONE;
srv->state.ttl = BT_MESH_TTL_DEFAULT;
srv->block.number = 0xffff;
memset(srv->block.missing, 0, sizeof(srv->block.missing));
srv->state.xfer.chunk_size = 0xffff;
k_work_cancel_delayable(&srv->rx_timeout);
k_work_cancel_delayable(&srv->pull.report);
Expand Down

0 comments on commit 5f4236e

Please sign in to comment.