]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r292583:
authorian <ian@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 19 Jan 2016 21:35:09 +0000 (21:35 +0000)
committerian <ian@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 19 Jan 2016 21:35:09 +0000 (21:35 +0000)
commit8b7ff56ec585d15003ecbd67536a8c87be047b31
treef00d343d5736873b767358cc9155979b00e3eab9
parentc878d4cabe1ad37e718a8055af6b84f37a9e6886
MFC r292583:

  Allow dhcp/bootp server-provided values to be overriden from environment
  variables in loader(8) and other libstand applications.

  Sometimes a dhcp server provides incorrect information along with the IP
  address. It would be useful to have a way to override this with
  locally-supplied information, such as command line parameters passed from a
  prior-stage bootloader. This change allows pre-existing env vars to take
  precedence over values delivered by the dhcp or bootp server.

  The bootp/dhcp code in libstand automatically creates environment variables
  from the data provided by the server (dhcp.root-path, dhcp.domain-name,
  etc). It also transcribes the values to some global variables such as
  'rootpath' and 'hostname'.

  This change does two things:

      When adding dhcp.* vars to the environment, don't replace existing
      vars/values.

      When setting the global vars rootpath and hostname, use the
      dhcp.root-path and dhcp.host-name env var values if they exist.

  This allows the platform-specific part of loader(8) to obtain override
  values in some platform-specific way and store them in the environment
  before opening the network device. The set of values that can be overriden
  is currently limited to just string options. The values that are delivered
  as binary data are things that probably shouldn't be overridden (IP,
  netmask, gateway, etc).

  The original patch this evolved from was submitted by martymac@

PR:           202098
Relnotes: Yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@294343 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libstand/bootp.c