diff options
author | Christoph Fritz <chf@fritzc.com> | 2014-04-30 10:32:01 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-05 09:18:45 +0200 |
commit | 5dafef6aaf81d96f92eff3365f62f18fe89b3136 (patch) | |
tree | a4ff461d799f96d8a9f05e06380cf1dd638ea1e2 | |
parent | ece46dd3fc3ca784aec50900b255c0b035bccf49 (diff) | |
download | barebox-5dafef6aaf81d96f92eff3365f62f18fe89b3136.tar.gz |
tftp: add timeframe when remote server is retransmitting
If there's packet loss and the remote server needs to retransmit,
there is falsely no timeframe left because TIMEOUT (server wait time)
and TFTP_TIMEOUT (abort timer) are the same.
This patch increases TFTP_TIMEOUT.
See RFC2349 for more info: http://tools.ietf.org/html/rfc2349
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | fs/tftp.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -33,14 +33,16 @@ #include <kfifo.h> #include <sizes.h> -#define TFTP_PORT 69 /* Well known TFTP port # */ -#define TIMEOUT 5 /* Seconds to timeout for a lost pkt */ +#define TFTP_PORT 69 /* Well known TFTP port number */ + +/* Seconds to wait before remote server is allowed to resend a lost packet */ +#define TIMEOUT 5 /* After this time without a response from the server we will resend a packet */ #define TFTP_RESEND_TIMEOUT SECOND /* After this time without progress we will bail out */ -#define TFTP_TIMEOUT (TIMEOUT * SECOND) +#define TFTP_TIMEOUT ((TIMEOUT * 3) * SECOND) /* * TFTP operations. |