All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramon Fried <rfried.dev@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] net: tftp: Avoid sending extra ack on completion
Date: Wed,  3 Feb 2021 10:07:50 +0200	[thread overview]
Message-ID: <20210203080750.18867-1-rfried.dev@gmail.com> (raw)

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 <suneelglinux@gmail.com>
Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
---
 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

             reply	other threads:[~2021-02-03  8:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  8:07 Ramon Fried [this message]
2021-02-03 18:43 ` [PATCH] net: tftp: Avoid sending extra ack on completion Suneel Garapati
2021-02-03 19:25   ` Ramon Fried
2021-02-03 20:56     ` Suneel Garapati

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210203080750.18867-1-rfried.dev@gmail.com \
    --to=rfried.dev@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.