diff options
Diffstat (limited to 'net/tftp.c')
-rw-r--r-- | net/tftp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/tftp.c b/net/tftp.c index 2e335413492..2e073183d5a 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -5,7 +5,6 @@ * Copyright 2011 Comelit Group SpA, * Luca Ceresoli <luca.ceresoli@comelit.it> */ -#include <common.h> #include <command.h> #include <display_options.h> #include <efi_loader.h> @@ -494,8 +493,15 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, tftp_prev_block = tftp_cur_block; tftp_cur_block = (unsigned short)(block + 1); update_block_number(); - if (ack_ok) + if (ack_ok) { + if (block == 0 && + tftp_state == STATE_SEND_WRQ){ + /* connection's first ACK */ + tftp_state = STATE_DATA; + tftp_remote_port = src; + } tftp_send(); /* Send next data block */ + } } } #endif @@ -695,7 +701,6 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, } } - static void tftp_timeout_handler(void) { if (++timeout_count > timeout_count_max) { |