summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu, Josh <Josh.wu@atmel.com>2014-11-18 13:07:08 +0800
committerTom Rini <trini@ti.com>2014-12-08 09:35:41 -0500
commitecec4e9c820a2faa2115adb9a8259aa6ba5da68d (patch)
tree5020d864e6d21883b0de7265480c77fdf66f802a
parent27e77183a1d1c355d225cb08fb35cdce54b87198 (diff)
downloadu-boot-imx-ecec4e9c820a2faa2115adb9a8259aa6ba5da68d.zip
u-boot-imx-ecec4e9c820a2faa2115adb9a8259aa6ba5da68d.tar.gz
u-boot-imx-ecec4e9c820a2faa2115adb9a8259aa6ba5da68d.tar.bz2
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 <josh.wu@atmel.com>
-rw-r--r--net/bootp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bootp.c b/net/bootp.c
index d4c86cf..8106601 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)