From: Harm Berntsen Date: Fri, 27 Nov 2020 21:45:56 +0000 (+0000) Subject: net: tftp: Fix incorrect tftp_next_ack on no OACK X-Git-Tag: baikal/mips/sdk5.9~34^2^2~237^2~7 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=48c8a817067920095e0a2edb5ade6d393cc2bc35;p=uboot.git 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 CC: Ramon Fried Reviewed-By: Ramon Fried --- diff --git a/net/tftp.c b/net/tftp.c index 2cfa0b1486..03079ded34 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) {