mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: chf.fritz@googlemail.com
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] tftp: add timeframe when remote server is retransmitting
Date: Wed, 30 Apr 2014 10:32:01 +0200	[thread overview]
Message-ID: <5360b518.c62a980a.05b6.526c@mx.google.com> (raw)
In-Reply-To: <1398846723-10241-1-git-send-email-y>

From: Christoph Fritz <chf@fritzc.com>

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>
---
 fs/tftp.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/tftp.c b/fs/tftp.c
index 9cad18f..b1a213e 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -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.
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

       reply	other threads:[~2014-04-30  8:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1398846723-10241-1-git-send-email-y>
2014-04-30  8:32 ` chf.fritz [this message]
2014-05-05  7:20   ` Sascha Hauer
2014-04-30  8:32 ` [PATCH 2/3] net cpsw: fix rx stability under heavy network load chf.fritz
2014-05-05  7:21   ` Sascha Hauer
2014-04-30  8:32 ` [PATCH 3/3] net cpsw: check phy status on send and receive chf.fritz
2014-05-05  7:22   ` Sascha Hauer
2014-05-05  8:36     ` Christoph Fritz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5360b518.c62a980a.05b6.526c@mx.google.com \
    --to=chf.fritz@googlemail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox