mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH net-pu] tftp: fix push for servers supporting 'option acknowledgement'
@ 2010-06-27  5:17 Baruch Siach
  0 siblings, 0 replies; only message in thread
From: Baruch Siach @ 2010-06-27  5:17 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-27  5:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-27  5:17 [PATCH net-pu] tftp: fix push for servers supporting 'option acknowledgement' Baruch Siach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox