From patchwork Tue Nov 18 05:07:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Wu X-Patchwork-Id: 411907 X-Patchwork-Delegate: trini@ti.com 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 82FB614011E for ; Tue, 18 Nov 2014 16:07:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 98E0C4B64D; Tue, 18 Nov 2014 06:07:50 +0100 (CET) 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 TuMT2CX+A1yQ; Tue, 18 Nov 2014 06:07:50 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BAAB34B632; Tue, 18 Nov 2014 06:07:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C9BEB4B632 for ; Tue, 18 Nov 2014 06:07:44 +0100 (CET) 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 Hx3I9UJm8sN8 for ; Tue, 18 Nov 2014 06:07:44 +0100 (CET) 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 eusmtp01.atmel.com (eusmtp01.atmel.com [212.144.249.242]) by theia.denx.de (Postfix) with ESMTPS id 9D6324B62F for ; Tue, 18 Nov 2014 06:07:40 +0100 (CET) Received: from apsmtp01.atmel.com (10.168.254.31) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.2.347.0; Tue, 18 Nov 2014 06:07:35 +0100 Received: from melon.corp.atmel.com (10.168.254.13) by apsmtp01.atmel.com (10.168.254.31) with Microsoft SMTP Server id 14.2.347.0; Tue, 18 Nov 2014 13:09:00 +0800 From: Josh Wu To: Date: Tue, 18 Nov 2014 13:07:08 +0800 Message-ID: <1416287228-12354-1-git-send-email-josh.wu@atmel.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Subject: [U-Boot] [PATCH] net: bootp: as CONFIG_BOOTP_SERVERIP is defined, keep bootfile not changed X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 Currenly when CONFIG_BOOTP_SERVERIP is defined, the SERVERIP is not changed when receive the BOOTP packet. But BOOTFILE is changed via BOOTP packet. As we will load the BOOTFILE from SERVERIP, if the BOOTFILE is modified by bootp packet but SERVERIP is not, that is not make sense. This patch make SERVERIP and BOOTFILE be consistent. If we define the CONFIG_BOOTP_SERVERIP, then SERVERIP and BOOTFILE will not changed by BOOTP packet. Only IP address is changed. Signed-off-by: Josh Wu --- net/bootp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bootp.c b/net/bootp.c index 189a003..479bb20 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -104,8 +104,6 @@ static void BootpCopyNetParams(struct Bootp_t *bp) if (tmp_ip != 0) NetCopyIP(&NetServerIP, &bp->bp_siaddr); memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6); -#endif - NetCopyIP(&NetOurIP, &bp->bp_yiaddr); if (strlen(bp->bp_file) > 0) copy_filename(BootFile, bp->bp_file, sizeof(BootFile)); @@ -117,6 +115,8 @@ static void BootpCopyNetParams(struct Bootp_t *bp) */ if (*BootFile) setenv("bootfile", BootFile); +#endif + NetCopyIP(&NetOurIP, &bp->bp_yiaddr); } static int truncate_sz(const char *name, int maxlen, int curlen)