aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-12-08 12:59:25 +0100
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-12-20 17:56:48 +0100
commitf272ce8b47a6dd561dc30cbdacf395bcdf885438 (patch)
treee63b3e4da1e8f59f9d23d6fe7d4a6b47d9e0c5be
parent848199fff60a80840a2a20a833ae0f617a975a21 (diff)
downloadSLOF-f272ce8b47a6dd561dc30cbdacf395bcdf885438.zip
SLOF-f272ce8b47a6dd561dc30cbdacf395bcdf885438.tar.gz
SLOF-f272ce8b47a6dd561dc30cbdacf395bcdf885438.tar.bz2
Repeat TFTP read request in case the packet got lost.
The TFTP downloads failed when the read request packet got lost. This problem is now fixed by retransmitting the read request after a while. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
-rw-r--r--clients/net-snk/app/netlib/tftp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/clients/net-snk/app/netlib/tftp.c b/clients/net-snk/app/netlib/tftp.c
index e8e9d09..dd1e752 100644
--- a/clients/net-snk/app/netlib/tftp.c
+++ b/clients/net-snk/app/netlib/tftp.c
@@ -556,8 +556,14 @@ tftp(filename_ip_t * _fn_ip, unsigned char *_buffer, int _len,
if(get_timer() <= 0) {
/* the server doesn't seem to retry let's help out a bit */
if (tftp_err->no_packets > 4 && port_number != -1
- && block > 1)
+ && block > 1) {
send_ack(block, port_number);
+ }
+ else if (port_number == -1 && block == 0
+ && (tftp_err->no_packets&3) == 3) {
+ printf("\nRepeating TFTP read request...\n");
+ send_rrq();
+ }
tftp_err->no_packets++;
set_timer(TICKS_SEC);
}