summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHarm Berntsen <[email protected]>2020-11-27 21:45:56 +0000
committerTom Rini <[email protected]>2021-01-19 09:15:02 -0500
commitbeb61e13b8134c9aeaf1b2c0a2e13ed71d3be59e (patch)
tree06ba542b2ae61abc2320f83530e78053f1c64de8 /net
parent51723c5581241a3886a5adaa780c09138163d0b2 (diff)
net: tftp: Fix incorrect tftp_next_ack on no OACK
When the tftp server did not send any OACK, the tftp_next_ack variable was not set to the correct value . As the server was transmitting blocks we generated a lot of 'Received unexpected block: $n, expected $n+1' error messages. Depending on the timeout setting the transfer could still complete though. Signed-off-by: Harm Berntsen <[email protected]> CC: Ramon Fried <[email protected]> Reviewed-By: Ramon Fried <[email protected]>
Diffstat (limited to 'net')
-rw-r--r--net/tftp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tftp.c b/net/tftp.c
index 2cfa0b1486f..03079ded34e 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -630,8 +630,10 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
tftp_cur_block++;
tftp_cur_block %= TFTP_SEQUENCE_SIZE;
- if (tftp_state == STATE_SEND_RRQ)
+ if (tftp_state == STATE_SEND_RRQ) {
debug("Server did not acknowledge any options!\n");
+ tftp_next_ack = tftp_windowsize;
+ }
if (tftp_state == STATE_SEND_RRQ || tftp_state == STATE_OACK ||
tftp_state == STATE_RECV_WRQ) {