Skip to content
Commit 0ca2a3cc authored by Robert Lubos's avatar Robert Lubos Committed by Anas Nashif
Browse files

net: lib: lwm2m: Fix expected block calculation



Coverity reported that a formula used to calculate the next expected
block in case the block size from the request differs our own block size
has a bug. The expression used to calculate the block size diff would
evaluate to an unsigned integer, giving (wrongly) enormous results in
case block size from the request is smaller than the Zephyr's default.

It turns out however, that this formula is no longer needed at all.
Since commit d3081e2f, Zephyr's LwM2M
implementation will no longer negotiate the block size in case of write
operation, but simply comply with the block size included in the
request. This means that calculating the diff makes no longer sense and
can be safely removed - the next expected block number should be simply
increased by 1.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 0528df9a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment