net: tftp: Fix load_block offset calculation
authorLey Foon Tan <ley.foon.tan@intel.com>
Tue, 25 Aug 2020 02:26:37 +0000 (10:26 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 30 Sep 2020 20:48:18 +0000 (16:48 -0400)
commitf6a158b996b3abee4e6315b29a488398cb3946df
tree53db6ad1efad50666b6e94ce4b4ec9516be0e3e0
parentae0bdf09ca9737d5db9453966cf4705bdd420d31
net: tftp: Fix load_block offset calculation

When load the last block, the "len" might not be a block size. This cause
loading the incorrect last block data.

The fix change "len" to tftp_block_size and minus one tftp_block_size
for offset calculation.

Use same offset calculation formula as in store_block().

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
net/tftp.c