public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chase Maupin <chase.maupin2003@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] Preventing overriding of serverip when set in environment by user
Date: Wed, 18 Apr 2012 13:46:42 -0500	[thread overview]
Message-ID: <4f8f0c1c.c55ab60a.040e.ffff8b3b@mx.google.com> (raw)
In-Reply-To: <20120418152806.3AE51202B25@gemini.denx.de>

> -----Original Message-----
> From: Wolfgang Denk [mailto:wd at denx.de]
> Sent: Wednesday, April 18, 2012 10:28 AM
> To: Maupin, Chase
> Cc: u-boot at lists.denx.de; Rini, Tom
> Subject: Re: [U-Boot] [RFC] Preventing overriding of serverip when
> set in environment by user
> 
> Dear "Maupin, Chase",
> 
> In message
> <7D46E86EC0A8354091174257B2FED10138DD6205@DLEE12.ent.ti.com> you
> wrote:
> >
> > I recently was trying out a Linksys WRT54G2 V1 router and
> 
> Thi sis out-of-tree code, so we cannot help much - we hav eno idea
> which modifications they made to the code.
> 
> > So the net effect was that the dhcp server in this router was
> > providing information in its response packet that was overriding
> the
> > setting I had programmed. I dug into the u-boot code a little and
> 
> This is normal, and intended.  If you run DHCP, the information
> returned from the server is put in the respective environment
> variables.  That's how it works.
> 
> Note however, that of course this will not change the persistent
> copy
> of the environment - to do that, you would have to run "saveenv".
> 
> > The first was to set CONFIG_BOOTP_SERVERIP in my board config
> file.
> > I discarded this because this would seem to make me always ignore
> the
> > serverip setting from the DHCP server, and it seemed likely that
> > there were cases where you would want this.
> 
> I don;t understand your description here, but indeed, putting
> CONFIG_BOOTP_SERVERIP in the config file almost never makes sense,
> and
> it is definitly not acceptable for mainline.
> 
> > The second was to check if the serverip was already set in the
> > environment and if so then not override that value with the one
> in
> > the response from the DHCP server. The below patch snippet does
> this
> 
> This is not what is supposed to happen.  You are breaking regular
> functionality this way.
> 
> > Is this the proper way to fix this issue and the right location
> to
> > make the change? The overall goal was to make sure that if I
> > specified a particular serverip that I wanted to use, then the
> DHCP
> > server should not be changing that.
> 
> No, this is not an acceptable patch.
> 
> What exactly _are_ you trying to fix?  What is wrong with using the
> DHCP server supplied address?  If it is incorrect, you should fix
> your
> DHCP server configuration.
> 

I can see your point.  Why treat serverip any different than the ipaddr returned from the DHCP server?  I guess this can be worked around by resetting serverip between the dhcp command and the tftp command (using autoload off).  Or I can take the approach I am currently using which is to put the linksys router away and buy a cheap trendnet router that doesn't do this :)

> Best regards,
> 
> Wolfgang Denk
> 
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev
> Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
> wd at denx.de
> You may call me by my name, Wirth, or by my value, Worth.
> - Nicklaus Wirth

  parent reply	other threads:[~2012-04-18 18:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 13:28 [U-Boot] [RFC] Preventing overriding of serverip when set in environment by user Maupin, Chase
2012-04-18 15:28 ` Wolfgang Denk
2012-04-18 15:46   ` Peter Barada
2012-04-18 19:14     ` Wolfgang Denk
2012-04-19  9:13     ` Stefano Babic
2012-04-23 13:39       ` Maupin, Chase
2012-04-18 18:46   ` Chase Maupin [this message]
     [not found]   ` <7D46E86EC0A8354091174257B2FED10138DD6FB8@DLEE12.ent.ti.com>
2012-04-18 19:29     ` Wolfgang Denk

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=4f8f0c1c.c55ab60a.040e.ffff8b3b@mx.google.com \
    --to=chase.maupin2003@gmail.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