[PATCH net-pu] tftp: fix push for servers supporting 'option acknowledgement'

Baruch Siach baruch at tkos.co.il
Sun Jun 27 01:17:16 EDT 2010


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 at 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




More information about the barebox mailing list