Skip to content
Commit ae0bdf09 authored by Ley Foon Tan's avatar Ley Foon Tan Committed by Tom Rini
Browse files

net: tftp: Fix store_block offset calculation



tftp_cur_block start with 1 for first block, but tftp_cur_block counter is
start with zero when block number is rollover. The existing code
"tftp_cur_block - 1" will cause the block number become -1 in store_block()
when tftp_cur_block is 0 when tftp_cur_block is rollover.

The fix pass in tftp_cur_block to store_block() and minus the
tftp_block_size when do the offset calculation.

Signed-off-by: default avatarLey Foon Tan <ley.foon.tan@intel.com>
Reviewed-By: default avatarRamon Fried <rfried.dev@gmail.com>
parent 6bf46367
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment