diff options
author | rockly <rockly703@gmail.com> | 2013-08-03 18:09:05 +0800 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2013-11-22 14:39:31 -0600 |
commit | f754f5dc6fe4b6cfbd28a9a6d9d08059d9312101 (patch) | |
tree | 13a44100a337a2bafab5cb916d24227dab7dfdf5 /net/tftp.c | |
parent | c2e5e802ecb7ab668ce9911b210ed68c804b349f (diff) | |
download | u-boot-imx-f754f5dc6fe4b6cfbd28a9a6d9d08059d9312101.zip u-boot-imx-f754f5dc6fe4b6cfbd28a9a6d9d08059d9312101.tar.gz u-boot-imx-f754f5dc6fe4b6cfbd28a9a6d9d08059d9312101.tar.bz2 |
net: tftp: Make sure timeout will not effect wrap offset
When the block 0 store to the memory of client and timeout at this
moment. Because of no ACK packet, the server will send block 0 again,
if this client reconnect to the server at this time,
TftpBlockWrapOffset will become larger than it should be.
Signed-off-by: Rockly <rocklygnome@gmail.com>
Patch: 264417
Diffstat (limited to 'net/tftp.c')
-rw-r--r-- | net/tftp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -281,7 +281,7 @@ static void update_block_number(void) * number of 0 this means that there was a wrap * around of the (16 bit) counter. */ - if (TftpBlock == 0) { + if (TftpBlock == 0 && TftpLastBlock != 0) { TftpBlockWrap++; TftpBlockWrapOffset += TftpBlkSize * TFTP_SEQUENCE_SIZE; TftpTimeoutCount = 0; /* we've done well, reset thhe timeout */ |