mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: [PATCH net-pu] tftp: fix push for servers supporting 'option acknowledgement'
Date: Sun, 27 Jun 2010 08:17:16 +0300	[thread overview]
Message-ID: <e049fe5636cc213f485e3d24a3dcbd6c246e8ee5.1277615744.git.baruch@tkos.co.il> (raw)

When doing push receiving 'option acknowledgement' should move the protocol to
state WDATA, and set block number to 1.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 net/tftp.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/tftp.c b/net/tftp.c
index 14d9b5e..20fab78 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -186,6 +186,10 @@ static void tftp_handler(char *packet, unsigned len)
 	case TFTP_OACK:
 		debug("Got OACK: %s %s\n", pkt, pkt + strlen(pkt) + 1);
 		tftp_state = STATE_OACK;
+		if (tftp_put) {
+			tftp_block = 1;
+			tftp_state = STATE_WDATA;
+		}
 		tftp_server_port = ntohs(udp->uh_sport);
 		tftp_con->udp->uh_dport = udp->uh_sport;
 		tftp_send(); /* Send ACK */
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2010-06-27  5:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=e049fe5636cc213f485e3d24a3dcbd6c246e8ee5.1277615744.git.baruch@tkos.co.il \
    --to=baruch@tkos.co.il \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox