Skip to content
Snippets Groups Projects
Commit ecec4e9c authored by Wu, Josh's avatar Wu, Josh Committed by Tom Rini
Browse files

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: default avatarJosh Wu <josh.wu@atmel.com>
parent 27e77183
No related branches found
No related tags found
No related merge requests found
...@@ -145,8 +145,6 @@ static void BootpCopyNetParams(struct Bootp_t *bp) ...@@ -145,8 +145,6 @@ static void BootpCopyNetParams(struct Bootp_t *bp)
if (tmp_ip != 0) if (tmp_ip != 0)
NetCopyIP(&NetServerIP, &bp->bp_siaddr); NetCopyIP(&NetServerIP, &bp->bp_siaddr);
memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6); memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6);
#endif
NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
if (strlen(bp->bp_file) > 0) if (strlen(bp->bp_file) > 0)
copy_filename(BootFile, bp->bp_file, sizeof(BootFile)); copy_filename(BootFile, bp->bp_file, sizeof(BootFile));
...@@ -158,6 +156,8 @@ static void BootpCopyNetParams(struct Bootp_t *bp) ...@@ -158,6 +156,8 @@ static void BootpCopyNetParams(struct Bootp_t *bp)
*/ */
if (*BootFile) if (*BootFile)
setenv("bootfile", BootFile); setenv("bootfile", BootFile);
#endif
NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
} }
static int truncate_sz(const char *name, int maxlen, int curlen) static int truncate_sz(const char *name, int maxlen, int curlen)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment