diff mbox

[U-Boot,v2,01/10] net: Revert "tftp: adjust settings to be suitable for 100Mbit ethernet"

Message ID 1440595055-26333-1-git-send-email-bmeng.cn@gmail.com
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Aug. 26, 2015, 1:17 p.m. UTC
Commit 620776d "tftp: adjust settings to be suitable for 100Mbit ethernet"
causes the following error message when trying to load a file using 'tftp'
command via a tftp server.

    TFTP error: 'Unsupported option(s) requested' (8)

This is due to with commit 620776d changes, the tftp option 'timeout'
value is now set to zero which is an invalid value as per RFC2349 [1].
Valid values range between "1" and "255" seconds, inclusive. With some
tftp servers that strictly implement the RFC requirement, it reports
such an error message.

Revert commit 620776d for RFC compliance.

[1] https://www.ietf.org/rfc/rfc2349.txt

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

Changes in v2:
- Rewrite the commit message to mention RFC2349

 net/tftp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Joe Hershberger Aug. 26, 2015, 2:50 p.m. UTC | #1
On Wed, Aug 26, 2015 at 8:17 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
> Commit 620776d "tftp: adjust settings to be suitable for 100Mbit ethernet"
> causes the following error message when trying to load a file using 'tftp'
> command via a tftp server.
>
>     TFTP error: 'Unsupported option(s) requested' (8)
>
> This is due to with commit 620776d changes, the tftp option 'timeout'
> value is now set to zero which is an invalid value as per RFC2349 [1].
> Valid values range between "1" and "255" seconds, inclusive. With some
> tftp servers that strictly implement the RFC requirement, it reports
> such an error message.
>
> Revert commit 620776d for RFC compliance.
>
> [1] https://www.ietf.org/rfc/rfc2349.txt
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

You should always copy the author of the patch you are reverting.
Bin Meng Aug. 26, 2015, 3:06 p.m. UTC | #2
Hi Joe,

On Wed, Aug 26, 2015 at 10:50 PM, Joe Hershberger
<joe.hershberger@gmail.com> wrote:
> On Wed, Aug 26, 2015 at 8:17 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Commit 620776d "tftp: adjust settings to be suitable for 100Mbit ethernet"
>> causes the following error message when trying to load a file using 'tftp'
>> command via a tftp server.
>>
>>     TFTP error: 'Unsupported option(s) requested' (8)
>>
>> This is due to with commit 620776d changes, the tftp option 'timeout'
>> value is now set to zero which is an invalid value as per RFC2349 [1].
>> Valid values range between "1" and "255" seconds, inclusive. With some
>> tftp servers that strictly implement the RFC requirement, it reports
>> such an error message.
>>
>> Revert commit 620776d for RFC compliance.
>>
>> [1] https://www.ietf.org/rfc/rfc2349.txt
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
>
> You should always copy the author of the patch you are reverting.

Sorry, I should have. I believe this can be handled automatically by
patman's --cc-cmd, like "--cc-cmd "./tools/patman/patman --cc-cmd
/tmp/patman.17080""? But unfortunately I never get this work.

Regards,
Bin
diff mbox

Patch

diff --git a/net/tftp.c b/net/tftp.c
index 18ce84c..89be32a 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -19,10 +19,10 @@ 
 /* Well known TFTP port # */
 #define WELL_KNOWN_PORT	69
 /* Millisecs to timeout for lost pkt */
-#define TIMEOUT		100UL
+#define TIMEOUT		5000UL
 #ifndef	CONFIG_NET_RETRY_COUNT
 /* # of timeouts before giving up */
-# define TIMEOUT_COUNT	1000
+# define TIMEOUT_COUNT	10
 #else
 # define TIMEOUT_COUNT  (CONFIG_NET_RETRY_COUNT * 2)
 #endif
@@ -711,10 +711,10 @@  void tftp_start(enum proto_t protocol)
 	if (ep != NULL)
 		timeout_ms = simple_strtol(ep, NULL, 10);
 
-	if (timeout_ms < 10) {
-		printf("TFTP timeout (%ld ms) too low, set min = 10 ms\n",
+	if (timeout_ms < 1000) {
+		printf("TFTP timeout (%ld ms) too low, set min = 1000 ms\n",
 		       timeout_ms);
-		timeout_ms = 10;
+		timeout_ms = 1000;
 	}
 
 	debug("TFTP blocksize = %i, timeout = %ld ms\n",