Page MenuHomeFreeBSD

dhclient: support option 114, default-url ascii
ClosedPublic

Authored by dch on Thu, Nov 21, 9:11 AM.

Details

Summary

This will enable further automation of HTTP UEFI boot loader support by
enabling a specific option for providing the boot URL to FreeBSD. The
114 option is already in use for undisclosed purposes at Apple, and in
common usage in the OpenCompute project for this scenario.

Documented in:

https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml
https://kb.isc.org/docs/isc-dhcp-44-manual-pages-dhcp-options
https://tools.ietf.org/html/rfc3679
https://opencomputeproject.github.io/onie/user-guide/index.html#basic-dhcp-scenario-1-specify-installer-image-url

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dch created this revision.Thu, Nov 21, 9:11 AM
dch updated this revision to Diff 64667.Thu, Nov 21, 11:04 AM

Add option handling to lookup table

dch added a comment.Thu, Nov 21, 11:07 AM

This allows a suitable DHCPD like ISC-DHCPD to string option 114,
and have the client receive in its DHCP parameters, what HTTP boot
URL was used. Ideally the kernel will know how to pass this data
through from boot time, but this is a reasonable starting point
to at least ensure the option is readable when dhclient itself
starts up.

Note that option 114 is in use for this scenario in numerous places
and is documented at IANA but not explicitly for any given purpose,
just "used at APPLE". I think this is a reasonable justification,
and other projects such as ONIE are also using it for this purpose.

lease {
  interface "igb0";
  fixed-address 172.16.1.4;
  next-server 172.16.1.1;
  filename "ipxe.pxe";
  option subnet-mask 255.255.255.0;
  option routers 172.16.1.1;
  option domain-name-servers 172.16.1.1;
  option domain-name "skunkwerks.at";
  option dhcp-lease-time 864000;
  option dhcp-message-type 5;
  option dhcp-server-identifier 172.16.1.1;
  option dhcp-class-identifier "default";
  option url "http://config/host";
  renew 2 2019/11/26 11:02:57;
  rebind 6 2019/11/30 05:02:57;
  expire 0 2019/12/1 11:02:57;
}
dch added reviewers: bcran, emaste.EditedThu, Nov 21, 11:10 AM

Hi Rebecca, Ed, this hopefully follows on from the HTTP boot work already done.
If you can suggest better reviewers please let me know. I'd like to MFC this
to stable as well if all is accepted.

Functionally, this patch simply removes an annoying error message
unknown option 0x72 and replaces it with an accepted parameter:

option url "http://your.fancy.url/here";

that is then nicely available in the usual /var/db/dhclient.leases.${IFACE}

dch added a reviewer: markj.Thu, Nov 21, 2:42 PM

added Mark as most recent committer in this area

I think this is fine, but can you explain the "114 option is already in use for undisclosed purposes at Apple" in more detail?

dch added a comment.Thu, Nov 21, 8:06 PM

I think this is fine, but can you explain the "114 option is already in use for undisclosed purposes at Apple" in more detail?

lol yes it's mentioned in RFC & IANA docs like this:

3.2. In Use by Apple

   The following option codes are used by devices from Apple Computer.
   However, none of these option codes have been described in a
   published RFC.

   The DHC WG will endeavor to have specifications for these options
   published.
The format and meaning of this option is not described in any standards document, but is claimed to be in use by Apple Computer.

Generally people are adopting it for exactly the sort of stuff we are - enabling config urls to be passed via DHCP to the OS.

emaste accepted this revision.Thu, Nov 21, 9:05 PM
This revision is now accepted and ready to land.Thu, Nov 21, 9:05 PM
This revision was automatically updated to reflect the committed changes.