From: Wu, Josh Date: Tue, 18 Nov 2014 05:07:08 +0000 (+0800) Subject: net: bootp: as CONFIG_BOOTP_SERVERIP is defined, keep bootfile not changed X-Git-Tag: v2015.01-rc3~34 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ecec4e9c820a2faa2115adb9a8259aa6ba5da68d;p=u-boot net: bootp: as CONFIG_BOOTP_SERVERIP is defined, keep bootfile not changed 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 --- diff --git a/net/bootp.c b/net/bootp.c index d4c86cf179..81066015f1 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -145,8 +145,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)); @@ -158,6 +156,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)