From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ramon Fried Date: Wed, 3 Feb 2021 10:07:50 +0200 Subject: [PATCH] net: tftp: Avoid sending extra ack on completion Message-ID: <20210203080750.18867-1-rfried.dev@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de in tftpboot, if ack was already sent previously for this packet, don't send again. Fixes: cc6b87ecaa96 ("net: tftp: Add client support for RFC 7440") Reported-by: Suneel Garapati Signed-off-by: Ramon Fried --- net/tftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tftp.c b/net/tftp.c index 03079ded34..1111834f71 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -678,7 +678,8 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, } if (len < tftp_block_size) { - tftp_send(); + if (tftp_cur_block != tftp_next_ack) + tftp_send(); tftp_complete(); } break; -- 2.17.1