[U-Boot] [PATCH v2 11/18] net: Don't write the "serverip" env var if configured not to

Simon Glass sjg at chromium.org
Thu Apr 12 06:26:18 CEST 2012


On Tue, Mar 27, 2012 at 4:43 PM, Joe Hershberger <joe.hershberger at ni.com> wrote:
> Before this patch, bootp would not overwrite the value, but the
> value was still clobbered in the env
>
> Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
> Cc: Joe Hershberger <joe.hershberger at gmail.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Mike Frysinger <vapier at gentoo.org>
> ---
> Changes for v2:
>   - Added a comment
>
>  common/cmd_net.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/common/cmd_net.c b/common/cmd_net.c
> index 65f32bc..97befd9 100644
> --- a/common/cmd_net.c
> +++ b/common/cmd_net.c
> @@ -153,12 +153,14 @@ static void netboot_update_env (void)
>                ip_to_string (NetOurIP, tmp);
>                setenv ("ipaddr", tmp);
>        }
> -
> +#if !defined(CONFIG_BOOTP_SERVERIP)
> +       /* Only attempt to change serverip if net/bootp.c:BootpCopyNetParams()
> +          could have set it */

Comment style

>        if (NetServerIP) {
>                ip_to_string (NetServerIP, tmp);
>                setenv ("serverip", tmp);
>        }
> -
> +#endif
>        if (NetOurDNSIP) {
>                ip_to_string (NetOurDNSIP, tmp);
>                setenv ("dnsip", tmp);
> --
> 1.6.0.2
>


More information about the U-Boot mailing list