]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Extract basic network settings from loaded image device path
authorMichael Brown <mcb30@ipxe.org>
Tue, 26 Mar 2024 15:17:23 +0000 (15:17 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 26 Mar 2024 15:57:58 +0000 (15:57 +0000)
commit9bbe77669c6e2b71826449d854f5aa0e2cee7767
tree9b396129645d4933c72e9f50497637b7f53a906a
parent170bbfd4875b2a3479101b5f5892cdedcf857fd0
[efi] Extract basic network settings from loaded image device path

The UEFI HTTP boot mechanism is extraordinarily badly designed, even
by the standards of the UEFI specification in general.  It has the
symptoms of a feature that has been designed entirely in terms of user
stories, without any consideration at all being given to the
underlying technical architecture.  It does work, provided that you
are doing precisely and only what was envisioned by the product owner.
If you want to try anything outside the bounds of the product owner's
extremely limited imagination, then you are almost certainly about to
enter a world of pain.

As one very minor example of this: the cached DHCP packet is not
available when using HTTP boot.  The UEFI HTTP boot code does perform
DHCP, but it pointlessly and unhelpfully throws away the DHCP packet
and trashes the network interface configuration before handing over to
the downloaded executable.

Work around this imbecility by parsing and applying the few network
configuration settings that are persisted into the loaded image's
device path.  This is limited to very basic information such as the IP
address, gateway address, and DNS server address, but it does at least
provide enough for a functional routing table.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/settings.h
src/interface/efi/efi_path.c