From patchwork Wed Aug 26 13:17:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 510855 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3D6581401C7 for ; Wed, 26 Aug 2015 23:15:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=nq8HF7RS; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 457B34B691; Wed, 26 Aug 2015 15:15:26 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QHa_POpMzOTI; Wed, 26 Aug 2015 15:15:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 367984B667; Wed, 26 Aug 2015 15:15:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 889E84B667 for ; Wed, 26 Aug 2015 15:15:21 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IFcO2expGoEl for ; Wed, 26 Aug 2015 15:15:21 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by theia.denx.de (Postfix) with ESMTPS id 14D184B65B for ; Wed, 26 Aug 2015 15:15:18 +0200 (CEST) Received: by pabzx8 with SMTP id zx8so70153044pab.1 for ; Wed, 26 Aug 2015 06:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=81A28HA0qRT2p3w/mlYukBk/guLIG2JBfYVk4SV97pA=; b=nq8HF7RSuKf+RZH85uvK4jp2ej4JKpHMrw7VGVFq97pxfy1P7kecstTC5faOQ6zZF+ oIxbMSzHPXz81mRDtOLKhXB6+8AkHR1RXju1Fmc8amoAbN8d8dp3zgiPjcVqgiQ/r3/9 o315X9v8+27/xLR0YbqsbQjVWRYSYnGluCKiIAcIsXMw1B6NzE/pYI6sxsllO5YeCn2s 1zaK/aNgnJOjLlkGJlIq75DIH6NxG0U0hHmA0vL+l56s3xjGclm2DkX7fK5R8Va58bKZ oaRpWGB/0KmLGqcyPbA+YXd8TpO9V6gKSwlBd+63zwT1t1DUeXOiVczfUEKy+RaezTWP 96Cw== X-Received: by 10.68.103.132 with SMTP id fw4mr69609594pbb.62.1440594916609; Wed, 26 Aug 2015 06:15:16 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-157-139.windriver.com. [147.11.157.139]) by smtp.gmail.com with ESMTPSA id hb1sm24712137pbd.36.2015.08.26.06.15.15 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Aug 2015 06:15:16 -0700 (PDT) From: Bin Meng To: Simon Glass , Joe Hershberger , U-Boot Mailing List , Tom Rini Date: Wed, 26 Aug 2015 06:17:26 -0700 Message-Id: <1440595055-26333-1-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 Subject: [U-Boot] [PATCH v2 01/10] net: Revert "tftp: adjust settings to be suitable for 100Mbit ethernet" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Acked-by: Joe Hershberger --- Changes in v2: - Rewrite the commit message to mention RFC2349 net/tftp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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",