Skip to content
Commit 7841ebf3 authored by Michael Scott's avatar Michael Scott Committed by Ioannis Glaropoulos
Browse files

net: lwm2m: firmware_pull: fix multiple last_block notifications

When the firmware_pull mechansim sends the callback to notify the
sample of a new firmware block, the user supplied buffer can be
smaller than the CoAP BLOCK_SIZE setting.  To handle this case,
we loop through the payload and fill the user supplied buffer with
smaller chunks.

Unfortunately, the last_block calculation is done outside this loop
which causes several callbacks (while in this loop) to have
last_block true.   Let's fix this by adding a small check to make
sure we're at the end of the current payload block before notifying
the user of a last_block.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16158



Signed-off-by: default avatarMichael Scott <mike@foundries.io>
parent efecc286
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment