From patchwork Wed Aug 31 10:36:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 112501 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 4B861B6F7B for ; Wed, 31 Aug 2011 20:36:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B6BF428089; Wed, 31 Aug 2011 12:36:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 W0mUWpOnm+VI; Wed, 31 Aug 2011 12:36:16 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 055DF28083; Wed, 31 Aug 2011 12:36:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C8A7528083 for ; Wed, 31 Aug 2011 12:36:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 0MigQ4cdvuEL for ; Wed, 31 Aug 2011 12:36:11 +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-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 0FE5B28080 for ; Wed, 31 Aug 2011 12:36:09 +0200 (CEST) Received: by bkar4 with SMTP id r4so594638bka.3 for ; Wed, 31 Aug 2011 03:36:09 -0700 (PDT) Received: by 10.204.137.214 with SMTP id x22mr140441bkt.354.1314786969033; Wed, 31 Aug 2011 03:36:09 -0700 (PDT) Received: from localhost ([178.23.216.97]) by mx.google.com with ESMTPS id x15sm23260bkd.59.2011.08.31.03.36.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Aug 2011 03:36:08 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Wed, 31 Aug 2011 12:36:07 +0200 Message-Id: <1314786967-23261-1-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.5.5.1 MIME-Version: 1.0 Cc: =?utf-8?q?Eric=20B=C3=A9nard?= Subject: [U-Boot] [PATCH] bootp: Fix bug in auto_load function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Patch: "Put common autoload code into auto_load() function" (sha1: 093498669e77597635a24f326f11efeab213d394) is not simple code cleanup but code change which introduce new bug. If autoload variable is not setup it worked as autoload=yes. Currently if autoload is not setup dhcp sends request in forever loop. There are two options how to fix it: 1. Move TftpStart() which is in this patch 2. Change functionality if autoload is not setup, set NetSate and ends. @@ -165,7 +165,8 @@ static void auto_load(void) } #endif TftpStart(); - } + } else + NetState = NETLOOP_SUCCESS; } CC: Eric BĂ©nard CC: Simon Glass Signed-off-by: Michal Simek --- net/bootp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/bootp.c b/net/bootp.c index 3db08ea..a003c42 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -164,8 +164,8 @@ static void auto_load(void) return; } #endif - TftpStart(); } + TftpStart(); } #if !defined(CONFIG_CMD_DHCP)