9
0
Fork 0

net: tftp: timeout only after a proper amount of time

Currently, the timeout when waiting for packages is smaller than the
timeout communicated to the TFTP server for retransmitting. Make sure we
wait at least for two retransmissions before giving up.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Wolfram Sang 2012-09-14 09:50:17 +02:00 committed by Sascha Hauer
parent 813aa7c2cc
commit fbe8f642b9
1 changed files with 2 additions and 1 deletions

View File

@ -354,7 +354,8 @@ static int do_tftpb(int argc, char *argv[])
tftp_retries++;
}
if (tftp_retries > PKT_NUM_RETRIES) {
/* Wait for two TIMEOUT periods and add some */
if (tftp_retries > 2 * TIMEOUT + 1) {
tftp_err = -ETIMEDOUT;
break;
}