From: Josh Wu <josh.wu@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: bootp: as CONFIG_BOOTP_SERVERIP is defined, keep bootfile not changed
Date: Thu, 4 Dec 2014 10:38:15 +0800 [thread overview]
Message-ID: <547FC917.3070103@atmel.com> (raw)
In-Reply-To: <1416287228-12354-1-git-send-email-josh.wu@atmel.com>
Hi,
Any feedback for this patch?
Best Regards,
Josh Wu
On 11/18/2014 1:07 PM, Josh Wu wrote:
> 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>
> ---
> 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)
next prev parent reply other threads:[~2014-12-04 2:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 5:07 [U-Boot] [PATCH] net: bootp: as CONFIG_BOOTP_SERVERIP is defined, keep bootfile not changed Josh Wu
2014-12-04 2:38 ` Josh Wu [this message]
2014-12-08 21:41 ` [U-Boot] " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=547FC917.3070103@atmel.com \
--to=josh.wu@atmel.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox