]> git.ipfire.org Git - thirdparty/ipxe.git/log
thirdparty/ipxe.git
11 years ago[crypto] Add support for subjectAltName and wildcard certificates
Michael Brown [Mon, 31 Mar 2014 00:11:06 +0000 (01:11 +0100)] 
[crypto] Add support for subjectAltName and wildcard certificates

Originally-implemented-by: Alex Chernyakhovsky <achernya@google.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Add subject alternative names to X.509 server test certificate
Michael Brown [Mon, 31 Mar 2014 12:32:26 +0000 (13:32 +0100)] 
[test] Add subject alternative names to X.509 server test certificate

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Add tests for x509_check_name()
Michael Brown [Mon, 31 Mar 2014 12:15:42 +0000 (13:15 +0100)] 
[test] Add tests for x509_check_name()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Rewrite CMS tests using okx()
Michael Brown [Mon, 31 Mar 2014 12:06:07 +0000 (13:06 +0100)] 
[test] Rewrite CMS tests using okx()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Rewrite X.509 tests using okx()
Michael Brown [Mon, 31 Mar 2014 12:00:54 +0000 (13:00 +0100)] 
[test] Rewrite X.509 tests using okx()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Allow signed timestamp error margin to be configured at build time
Michael Brown [Sun, 30 Mar 2014 19:07:14 +0000 (20:07 +0100)] 
[crypto] Allow signed timestamp error margin to be configured at build time

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Use fingerprint when no common name is available for debug messages
Michael Brown [Fri, 28 Mar 2014 18:42:41 +0000 (18:42 +0000)] 
[crypto] Use fingerprint when no common name is available for debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Generalise X.509 cache to a full certificate store
Michael Brown [Fri, 28 Mar 2014 15:45:10 +0000 (15:45 +0000)] 
[crypto] Generalise X.509 cache to a full certificate store

Expand the concept of the X.509 cache to provide the functionality of
a certificate store.  Certificates in the store will be automatically
used to complete certificate chains where applicable.

The certificate store may be prepopulated at build time using the
CERT=... build command line option.  For example:

  make bin/ipxe.usb CERT=mycert1.crt,mycert2.crt

Certificates within the certificate store are not implicitly trusted;
the trust list is specified using TRUST=... as before.  For example:

  make bin/ipxe.usb CERT=root.crt TRUST=root.crt

This can be used to embed the full trusted root certificate within the
iPXE binary, which is potentially useful in an HTTPS-only environment
in which there is no HTTP server from which to automatically download
cross-signed certificates or other certificate chain fragments.

This usage of CERT= extends the existing use of CERT= to specify the
client certificate.  The client certificate is now identified
automatically by checking for a match against the private key.  For
example:

  make bin/ipxe.usb CERT=root.crt,client.crt TRUST=root.crt KEY=client.key

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Add pubkey_match() to check for matching public/private key pairs
Michael Brown [Wed, 26 Mar 2014 23:12:56 +0000 (23:12 +0000)] 
[crypto] Add pubkey_match() to check for matching public/private key pairs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Add dependency of generated files upon Makefile
Michael Brown [Wed, 26 Mar 2014 21:36:41 +0000 (21:36 +0000)] 
[build] Add dependency of generated files upon Makefile

Ensure that any generated files (such as DER forms of X.509
certificates) are rebuilt if the Makefile changes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Disable ccache for all relevant build targets
Michael Brown [Wed, 26 Mar 2014 21:27:55 +0000 (21:27 +0000)] 
[build] Disable ccache for all relevant build targets

The build process currently attempts to disable ccache for files using
the .incbin directive, but the rule fails to apply to anything beyond
the simple object target.  Fix by applying to all relevant build
targets (including debug objects, assembly listings, and so on).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Remove long-obsolete mechanism for wrapping embedded images
Michael Brown [Wed, 26 Mar 2014 21:26:17 +0000 (21:26 +0000)] 
[build] Remove long-obsolete mechanism for wrapping embedded images

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Remove dynamically-allocated storage for certificate OCSP URI
Michael Brown [Tue, 25 Mar 2014 16:09:16 +0000 (16:09 +0000)] 
[crypto] Remove dynamically-allocated storage for certificate OCSP URI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Remove dynamically-allocated storage for certificate name
Michael Brown [Tue, 25 Mar 2014 15:01:32 +0000 (15:01 +0000)] 
[crypto] Remove dynamically-allocated storage for certificate name

iPXE currently allocates a copy the certificate's common name as a
string.  This string is used by the TLS and CMS code to check
certificate names against an expected name, and also appears in
debugging messages.

Provide a function x509_check_name() to centralise certificate name
checking (in preparation for adding subjectAlternativeName support),
and a function x509_name() to provide a name to be used in debugging
messages, and remove the dynamically allocated string.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[ocsp] Handle OCSP responses that don't provide certificates
Alexander Chernyakhovsky [Tue, 15 Oct 2013 20:03:11 +0000 (16:03 -0400)] 
[ocsp] Handle OCSP responses that don't provide certificates

Certificate authorities are not required to send the certificate used
to sign the OCSP response if the response is signed by the original
issuer.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[http] Accept Content-Length header with trailing whitespace
Michael Brown [Tue, 25 Mar 2014 15:42:46 +0000 (15:42 +0000)] 
[http] Accept Content-Length header with trailing whitespace

At least one HTTP server (Google's OCSP responder) has been observed
to generate a Content-Length header with trailing whitespace.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[bios] Fix screen clearing on even more buggy BIOSes
Michael Brown [Fri, 21 Mar 2014 11:07:29 +0000 (11:07 +0000)] 
[bios] Fix screen clearing on even more buggy BIOSes

Some BIOSes (observed with a ProLiant DL360p Gen8 SE) perform no range
checking whatsoever on the parameters passed to INT10,06 and will
therefore happily write to an area beyond the end of video RAM.  The
area immediately following the video RAM tends to be the VGA BIOS ROM
image.  Overwriting the VGA BIOS leads to an interesting variety of
crashes and reboots.

Fix by specifying an exact width and height to be cleared, rather than
passing in large values and relying upon the BIOS to truncate them to
the appropriate range.

Reported-by: Alex Davies <adavies@jumptrading.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[realtek] Clear bit 24 of RCR
Michael Brown [Mon, 17 Mar 2014 17:15:18 +0000 (17:15 +0000)] 
[realtek] Clear bit 24 of RCR

On an Asus Z87-K motherboard with an onboard 8168 NIC, booting into
Windows 7 and then warm rebooting into iPXE results in a broken RX
datapath: packets can be transmitted successfully but garbage is
received.  A cold reboot clears the problem.

A dump of the PHY registers reveals only one difference: in the
failure case the bits ADVERTISE_PAUSE_CAP and ADVERTISE_PAUSE_ASYM are
cleared.  Explicitly setting these bits does not fix the problem.

A dump of the MAC registers reveals a few differences, of which the
most obvious culprit is the undocumented bit 24 of the Receive
Configuration Register (RCR), which is set in the failure case.
Explicitly clearing this bit does fix the problem.

Reported-by: Sebastian Nielsen <ipxe@sebbe.eu>
Reported-by: Oliver Rath <rath@mglug.de>
Debugged-by: Sebastian Nielsen <ipxe@sebbe.eu>
Tested-by: Sebastian Nielsen <ipxe@sebbe.eu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[realtek] Add ability to dump all internal registers
Michael Brown [Fri, 14 Mar 2014 12:46:23 +0000 (12:46 +0000)] 
[realtek] Add ability to dump all internal registers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Disable SNP devices when running iPXE as the application
Michael Brown [Fri, 14 Mar 2014 14:16:05 +0000 (14:16 +0000)] 
[efi] Disable SNP devices when running iPXE as the application

Some UEFI builds will set up a timer to continuously poll any SNP
devices.  This can drain packets from the network device's receive
queue before iPXE gets a chance to process them.

Use netdev_rx_[un]freeze() to explicitly indicate when we expect our
network devices to be driven via the external SNP API (as we do with
the UNDI API on the standard BIOS build), and disable the SNP API
except when receive queue processing is frozen.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Unload our own image before exiting UEFI application
Michael Brown [Fri, 14 Mar 2014 15:56:36 +0000 (15:56 +0000)] 
[efi] Unload our own image before exiting UEFI application

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Avoid accidentally calling main() twice
Michael Brown [Fri, 14 Mar 2014 15:15:14 +0000 (15:15 +0000)] 
[efi] Avoid accidentally calling main() twice

EFIRC() uses PLATFORM_TO_ERRNO(), which evaluates its argument twice
(and can't trivially use a braced-group expression or an inline
function to avoid this, since it gets used outside of function
context).

The expression "EFIRC(main())" will therefore end up calling main()
twice, which is not the intended behaviour.  Every other instance of
EFIRC() is of the simple form "EFIRC(rc)", so fix by converting this
instance to match.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[netdevice] Notify upper-layer drivers when RX processing is (un)frozen
Michael Brown [Fri, 14 Mar 2014 14:05:38 +0000 (14:05 +0000)] 
[netdevice] Notify upper-layer drivers when RX processing is (un)frozen

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[lotest] Allow loopback testing on shared networks
Michael Brown [Thu, 13 Mar 2014 23:35:18 +0000 (23:35 +0000)] 
[lotest] Allow loopback testing on shared networks

Allow for extraneous packets to be received during loopback testing,
and so permit loopback tests to be performed when ports are connected
to a switch (rather than requiring ports to be directly connected with
a loopback cable).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[console] Fix display of characters with top bit set
Michael Brown [Thu, 13 Mar 2014 14:20:10 +0000 (14:20 +0000)] 
[console] Fix display of characters with top bit set

Inhibit implicit sign-padding of characters with the top bit set
(e.g. accented characters), which confuses the mucurses library by
colliding with the bits used to store character attributes and
colours.

Reported-by: Marc Delisle <Marc.Delisle@cegepsherbrooke.qc.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Connect driver to devices as part of installation
Michael Brown [Tue, 11 Mar 2014 15:34:47 +0000 (15:34 +0000)] 
[efi] Connect driver to devices as part of installation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Allow driver to be unloaded
Michael Brown [Mon, 10 Mar 2014 15:42:21 +0000 (15:42 +0000)] 
[efi] Allow driver to be unloaded

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Allow for 64-bit EFI_STATUS codes
Michael Brown [Mon, 10 Mar 2014 16:36:21 +0000 (16:36 +0000)] 
[efi] Allow for 64-bit EFI_STATUS codes

On a 64-bit build, EFI_STATUS codes are 64-bit quantities, with the
"error/warning" bit located in bit 63.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[image] Add "--timeout" parameter to image downloading commands
Michael Brown [Mon, 10 Mar 2014 13:32:39 +0000 (13:32 +0000)] 
[image] Add "--timeout" parameter to image downloading commands

iPXE will detect timeout failures in several situations: network
link-up, DHCP, TCP connection attempts, unacknowledged TCP data, etc.
This does not cover all possible circumstances.  For example, if a
connection to a web server is successfully established and the web
server acknowledges the HTTP request but never sends any data in
response, then no timeout will be triggered.  There is no timeout
defined within the HTTP specifications, and the underlying TCP
connection will not generate a timeout since it has no way to know
that the HTTP layer is expecting to receive data from the server.

Add a "--timeout" parameter to "imgfetch", "chain", etc.  If no
progress is made (i.e. no data is downloaded) within the timeout
period, then the download will be aborted.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[monojob] Reset timeout when progress is made
Michael Brown [Mon, 10 Mar 2014 13:16:18 +0000 (13:16 +0000)] 
[monojob] Reset timeout when progress is made

Redefine the timeout parameter from "time since start of job" to "time
since progress was last made".  This does not affect any existing
behaviour, since all existing users of the timeout parameter do not
provide progress indication.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[realtek] Dump all MII register contents when link status changes
Michael Brown [Mon, 10 Mar 2014 12:22:23 +0000 (12:22 +0000)] 
[realtek] Dump all MII register contents when link status changes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[mii] Add mii_dump() to dump all MII registers
Michael Brown [Mon, 10 Mar 2014 12:21:54 +0000 (12:21 +0000)] 
[mii] Add mii_dump() to dump all MII registers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[http] Automatically retry request on a 503 Service Unavailable
Michael Brown [Fri, 7 Mar 2014 17:19:36 +0000 (17:19 +0000)] 
[http] Automatically retry request on a 503 Service Unavailable

A web server may return a 503 Service Unavailable response along with
a Retry-After header to direct the client to retry the request at a
later time.

The Retry-After header may be a number of seconds, or a full HTTP
timestamp (e.g. "Fri, 7 Mar 2014 17:22:14 GMT").  We have no
reasonable way of parsing a full HTTP timestamp; if the server chooses
to use this format then we simply retry after a fixed 5-second delay.

As per RFC 2616, in the absence of a Retry-After header we treat a
status code of 503 Service Unavailable as being equivalent to 500
Internal Server Error, and immediately fail the request.

Requested-by: Suresh Sundriyal <ssundriy@vmware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[http] Use a retry timer to trigger retried requests
Michael Brown [Fri, 7 Mar 2014 16:45:45 +0000 (16:45 +0000)] 
[http] Use a retry timer to trigger retried requests

Use a retry timer to allow for the possibility of deferring a retried
request.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[linux] Avoid starting currticks() from zero every time
Michael Brown [Fri, 7 Mar 2014 16:40:36 +0000 (16:40 +0000)] 
[linux] Avoid starting currticks() from zero every time

iPXE uses currticks() (along with the MAC address(es) of any network
devices) to seed the (non-cryptographic) random number generator.  The
current implementation of linux_currticks() ensures that the first
call to currticks() will always return zero; this results in identical
random number sequences on each run of iPXE on a given machine.  This
can cause odd-looking behaviour due to e.g. the reuse of local TCP
port numbers.

Fix by effectively rounding down the start time recorded by
linux_currticks() to the nearest whole second; this makes it unlikely
that consecutive runs of iPXE will use the exact same RNG sequence.

(Note that none of this affects the cryptographic RNG, which uses
/dev/random as a source of entropy.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcp] Update window even if ACK does not acknowledge new data
Michael Brown [Wed, 5 Mar 2014 17:30:06 +0000 (17:30 +0000)] 
[tcp] Update window even if ACK does not acknowledge new data

iPXE currently ignores ACKs which do not acknowledge any new data.
(In particular, it does not stop the retransmission timer; this is
done to prevent an immediate retransmission if a duplicate ACK is
received while the transmit queue is non-empty.)

If a peer provides a window size of zero and later sends a duplicate
ACK to update the window size, this update will therefore be ignored
and iPXE will never be able to transmit data.

Fix by updating the window size even for ACKs which do not acknowledge
new data.

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[netdevice] Mark devices as open before calling open() method
Michael Brown [Wed, 5 Mar 2014 15:25:08 +0000 (15:25 +0000)] 
[netdevice] Mark devices as open before calling open() method

When opening a VLAN device, vlan_open() will call netdev_open() on the
trunk device.  This will result in a call to netdev_notify(), which
will cause vlan_notify() to call vlan_sync() on the original VLAN
device, which will see that the trunk device is now open but the VLAN
device apparently isn't (since it has not yet been flagged as open by
netdev_open()).  The upshot is a second attempt to open the VLAN
device, which will result in an erroneous second call to vlan_open().
This convoluted chain of events then terminates harmlessly since
vlan_open() calls netdev_open() on the trunk device, which just
returns immediately since the trunk device is by now flagged as being
already open.

Prevent this from happening by having netdev_open() flag the device as
open prior to calling the device's open() method, and reflagging it as
closed if the open() method fails.

Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[romprefix] Do not clobber stack segment when returning to BIOS
Michael Brown [Wed, 5 Mar 2014 12:25:21 +0000 (12:25 +0000)] 
[romprefix] Do not clobber stack segment when returning to BIOS

Commit c429bf0 ("[romprefix] Store boot bus:dev.fn address as autoboot
device location") introduced a regression by using register %cx to
temporarily hold the PCI bus:dev.fn address, despite the fact that %cx
was already being used to hold the stored BIOS stack segment.
Consequently, when returning to the BIOS after a failed or cancelled
boot attempt, iPXE would end up calling INT 18 with the stack segment
set equal to the PCI bus:dev.fn address.  Writing to essentially
random areas of memory tends to upset even the more robust BIOSes.

Fix by using register %ax to temporarily hold the PCI bus:dev.fn
address.

Reported-by: Anton D. Kachalov <mouse@yandex-team.ru>
Tested-by: Anton D. Kachalov <mouse@yandex-team.ru>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[realtek] Include link status register details in debug messages
Michael Brown [Tue, 4 Mar 2014 16:30:06 +0000 (16:30 +0000)] 
[realtek] Include link status register details in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[bzimage] Report exact initrd length via bzImage header
Michael Brown [Tue, 4 Mar 2014 14:30:45 +0000 (14:30 +0000)] 
[bzimage] Report exact initrd length via bzImage header

iPXE currently pads initrd images to a multiple of 4kB and inserts
zero padding between images, as required by some versions of the Linux
kernel.  The overall length reported via the ramdisk_size field in the
bzImage header includes this zero padding.

This causes problems when using memdisk to load a gzip-compressed disk
image.  memdisk treats the ramdisk_size field as containing the exact
length of the initrd image, and uses this length to locate the 8-byte
gzip footer.  This will generally cause memdisk to fail to decompress
the disk image.

Fix by reporting the exact length of the initrd image set, including
any padding inserted between images but excluding any padding added at
the end of the final image.

Reported-by: Levente LEVAI <levail@aviatronic.hu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcp] Calculate correct MSS from peer address
Michael Brown [Tue, 4 Mar 2014 13:14:13 +0000 (13:14 +0000)] 
[tcp] Calculate correct MSS from peer address

iPXE currently advertises a fixed MSS of 1460, which is correct only
for IPv4 over Ethernet.  For IPv6 over Ethernet, the value should be
1440 (allowing for the larger IPv6 header).  For non-Ethernet link
layers, the value should reflect the MTU of the underlying network
device.

Use tcpip_mtu() to calculate the transport-layer MTU associated with
the peer address, and calculate the MSS to allow for an optionless TCP
header as per RFC 6691.

As a side benefit, we can now fail a connection immediately with a
meaningful error message if we have no route to the destination
address.

Reported-by: Anton D. Kachalov <mouse@yandex-team.ru>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcpip] Provide tcpip_mtu() to determine the maximum transmission unit
Michael Brown [Tue, 4 Mar 2014 13:10:07 +0000 (13:10 +0000)] 
[tcpip] Provide tcpip_mtu() to determine the maximum transmission unit

Provide the function tcpip_mtu() to allow external code to determine
the (transport-layer) maximum transmission unit for a given socket
address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcpip] Provide tcpip_netdev() to determine the transmitting network device
Michael Brown [Tue, 4 Mar 2014 12:54:21 +0000 (12:54 +0000)] 
[tcpip] Provide tcpip_netdev() to determine the transmitting network device

Provide the function tcpip_netdev() to allow external code to
determine the transmitting network device for a given socket address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[prefix] Ignore PCI autoboot device location if set to 00:00.0
Michael Brown [Mon, 3 Mar 2014 16:23:41 +0000 (16:23 +0000)] 
[prefix] Ignore PCI autoboot device location if set to 00:00.0

qemu can load an option ROM which is not associated with a particular
PCI device using the "-option-rom" syntax.  Under these circumstances,
we should ignore the PCI bus:dev.fn address that we expect to find in
%ax on entry to the initialisation vector.

Fix by using the PCI bus:dev.fn address only if it is non-zero.  Since
00:00.0 will always be the host bridge, it can never be the address of
a network card.

Reported-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[romprefix] Store boot bus:dev.fn address as autoboot device location
Alex Williamson [Tue, 25 Feb 2014 23:00:44 +0000 (16:00 -0700)] 
[romprefix] Store boot bus:dev.fn address as autoboot device location

Per the BIOS Boot Specification, the initialization phase of the ROM
is called with the PFA (PCI Function Address) in the %ax register.
The intention is that the ROM code will store that device address
somewhere and use it for booting from that device when the Boot Entry
Vector (BEV) is called.  iPXE does store the PFA, but doesn't use it
to select the boot network device.  This renders BIOS IPL lists fairly
ineffective.

Fix by using the BBS-specified bus:dev.fn address as the autoboot
device location.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[prefix] Allow prefix to specify a PCI autoboot device location
Alex Williamson [Tue, 25 Feb 2014 23:00:39 +0000 (16:00 -0700)] 
[prefix] Allow prefix to specify a PCI autoboot device location

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[autoboot] Enable infrastructure to specify an autoboot device location
Alex Williamson [Tue, 25 Feb 2014 23:00:23 +0000 (16:00 -0700)] 
[autoboot] Enable infrastructure to specify an autoboot device location

iPXE will currently attempt to boot from every network device for
which it has a driver.  Where a system has more than one network
device supported by iPXE, this renders BIOS IPL lists ineffective.

Allow an autoboot device location to be specified.  If such a location
is specified, then only devices matching that location will be used as
part of the automatic boot sequence.  If no such location is
specified, then all devices will be used.

Note that this does not affect the "autoboot" command, which will
continue to use all devices.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[romprefix] Allow ROM banner timeout to be configured independently
Alex Williamson [Tue, 25 Feb 2014 23:33:08 +0000 (16:33 -0700)] 
[romprefix] Allow ROM banner timeout to be configured independently

iPXE currently prints a "Press Ctrl-B" banner twice: once when the ROM
is first called for initialisation and again if we attempt to boot
from the ROM.  This slows boot, especially when the NIC is not the
primary boot device.  Tools such as libguestfs make use of QEMU VMs
for performing maintenance on disk images and may make use of NICs in
the VM for network support.  If iPXE introduces a static init-time
delay, that directly translates to increased runtime for the tools.

Fix by allowing the ROM banner timeout to be configured independently
of the main banner timeout.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Add the "ipstat" command
Michael Brown [Sun, 2 Mar 2014 20:35:13 +0000 (20:35 +0000)] 
[cmdline] Add the "ipstat" command

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcpip] Add IP statistics collection as per RFC 4293
Michael Brown [Sun, 2 Mar 2014 20:33:35 +0000 (20:33 +0000)] 
[tcpip] Add IP statistics collection as per RFC 4293

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[image] Ensure every image has a fully resolved URI
Michael Brown [Tue, 25 Feb 2014 15:29:00 +0000 (15:29 +0000)] 
[image] Ensure every image has a fully resolved URI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[uri] Refactor URI parsing and formatting
Michael Brown [Thu, 27 Feb 2014 13:32:53 +0000 (13:32 +0000)] 
[uri] Refactor URI parsing and formatting

Add support for parsing of URIs containing literal IPv6 addresses
(e.g. "http://[fe80::69ff:fe50:5845%25net0]/boot.ipxe").

Duplicate URIs by directly copying the relevant fields, rather than by
formatting and reparsing a URI string.  This relaxes the requirements
on the URI formatting code and allows it to focus on generating
human-readable URIs (e.g. by not escaping ':' characters within
literal IPv6 addresses).  As a side-effect, this allows relative URIs
containing parameter lists (e.g. "../boot.php##params") to function
as expected.

Add validity check for FTP paths to ensure that only printable
characters are accepted (since FTP is a human-readable line-based
protocol with no support for character escaping).

Construct TFTP next-server+filename URIs directly, rather than parsing
a constructed "tftp://..." string,

Add self-tests for URI functions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[params] Use reference counters for form parameter lists
Michael Brown [Tue, 25 Feb 2014 14:03:40 +0000 (14:03 +0000)] 
[params] Use reference counters for form parameter lists

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[settings] Remove "uristring" setting type
Michael Brown [Mon, 17 Feb 2014 16:14:25 +0000 (16:14 +0000)] 
[settings] Remove "uristring" setting type

Commit b5f5f73 ("[cmdline] Expand settings within each command-line
token individually") effectively rendered the "uristring" setting type
obsolete, since strings containing whitespace no longer break the
command line parser.  The concept of the "uristring" type is not well
defined, since URI escaping rules depend on which portion of a URI is
being escaped.

Remove the "uristring" type, converting it into an alias for the
"string" setting type so as to avoid breaking existing scripts.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[dhcp] Copy exactly the required length when resizing DHCP options
Michael Brown [Wed, 26 Feb 2014 16:44:05 +0000 (16:44 +0000)] 
[dhcp] Copy exactly the required length when resizing DHCP options

When resizing DHCP options, iPXE currently calculates the length to be
copied by subtracting the destination pointer from the end of buffer
pointer.  This works and guarantees not to write beyond the end of the
buffer, but may end up reading beyond the end of the buffer.

Fix by calculating the required length exactly.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[dns] Update end-of-name pointer after processing CNAME record
Michael Brown [Wed, 26 Feb 2014 15:54:16 +0000 (15:54 +0000)] 
[dns] Update end-of-name pointer after processing CNAME record

Commit d4c0226 ("[dns] Support DNS search lists") introduced a
regression when handling CNAME records resolving to names longer than
the original name.  The "end of name" offset stored in dns->offset was
not updated to reflect the length of the new name, causing
dns_question() to append the (empty) search suffix at an incorrect
offset within the name buffer, resulting in a mangled DNS name.

In the case of a CNAME record resolving to a name shorter than or
equal in length to the original name, then the mangling would occur in
an unused portion of the name buffer.  In the common case of a name
server returning the A (or AAAA) record along with the CNAME record,
this would cause name resolution to succeed despite the mangling.  (If
the name server did not return the A or AAAA record along with the
CNAME record, then the mangling would be revealed by the subsequent
invalid query packet.)

Reported-by: Nicolas Sylvain <nsylvain@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[dns] Support DNS search lists
Michael Brown [Fri, 31 Jan 2014 18:16:42 +0000 (18:16 +0000)] 
[dns] Support DNS search lists

Update the DNS resolver to support DNS search lists (as provided by
DHCP option 119, DHCPv6 option 24, or NDP option 31).

Add validation code to ensure that parsing of DNS packets does not
overrun the input, get stuck in infinite loops, or (worse) write
beyond the end of allocated buffers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[intel] Add some missing PCI IDs
Michael Brown [Wed, 29 Jan 2014 16:43:39 +0000 (16:43 +0000)] 
[intel] Add some missing PCI IDs

Tested-by: Philipp Hagen <Philipp.Hagen@she.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Always clear screen after reconfiguring console
Michael Brown [Wed, 22 Jan 2014 22:32:40 +0000 (22:32 +0000)] 
[cmdline] Always clear screen after reconfiguring console

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[fbcon] Allow ANSI CUP with missing arguments
Michael Brown [Wed, 22 Jan 2014 22:42:59 +0000 (22:42 +0000)] 
[fbcon] Allow ANSI CUP with missing arguments

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Add margin options to the "console" command
Michael Brown [Wed, 22 Jan 2014 14:08:15 +0000 (14:08 +0000)] 
[cmdline] Add margin options to the "console" command

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Rename "console" command's --bpp option to --depth
Michael Brown [Wed, 22 Jan 2014 13:22:32 +0000 (13:22 +0000)] 
[cmdline] Rename "console" command's --bpp option to --depth

Rename the "--bpp" option to "--depth", to free up the single-letter
option "-b" for "--bottom" in preparation for adding margin support.

This does not break backwards compatibility with documented features,
since the "console" command has not yet been documented.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[vesafb] Allow for an arbitrary margin around the text area
Michael Brown [Wed, 22 Jan 2014 14:04:48 +0000 (14:04 +0000)] 
[vesafb] Allow for an arbitrary margin around the text area

Allow for an arbitrary margin to be specified in the console
configuration.  If the actual screen size does not match the requested
screen size, then update any margins specified so that they remain in
the same place relative to the requested screen size.  If margins are
unspecified (i.e. zero), then leave them as zero.

The underlying assumption here is that any specified margins are
likely to describe an area within a background picture, and so should
remain in the same place relative to that background picture.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[fbcon] Allow for an arbitrary margin around the text area
Michael Brown [Wed, 22 Jan 2014 13:57:07 +0000 (13:57 +0000)] 
[fbcon] Allow for an arbitrary margin around the text area

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[fbcon] Centre background picture on console
Michael Brown [Fri, 17 Jan 2014 17:44:50 +0000 (17:44 +0000)] 
[fbcon] Centre background picture on console

Centre the background picture on the console, to give a more
consistent result when the aspect ratio does not match the requested
width and height.

Once drawn for the first time, nothing should ever overwrite the
margins of the display.  We can therefore eliminate the logic used to
redraw only the margin areas, and use much simpler code to draw the
complete initial background image.

Simplify the redrawing logic further by making the background picture
buffer equal in size to the frame buffer.  In the common case of a
background picture which is designed to fill the screen, this wastes
no extra memory, and the combined code simplifications reduce the size
of fbcon.o by approximately 15%.

Redefine the concept of "margin" to match the intuitive definition
(i.e. the size of the gap, rather than the position of the boundary
line).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[vesafb] Handle failures from fbcon_init()
Michael Brown [Wed, 22 Jan 2014 14:03:57 +0000 (14:03 +0000)] 
[vesafb] Handle failures from fbcon_init()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[png] Add support for PNG images
Michael Brown [Mon, 6 Jan 2014 17:59:21 +0000 (18:59 +0100)] 
[png] Add support for PNG images

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Generalise pnm_ok() to pixbuf_ok()
Michael Brown [Mon, 6 Jan 2014 19:10:18 +0000 (19:10 +0000)] 
[test] Generalise pnm_ok() to pixbuf_ok()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Rewrite pnm_ok() using okx()
Michael Brown [Mon, 6 Jan 2014 17:58:46 +0000 (18:58 +0100)] 
[test] Rewrite pnm_ok() using okx()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[uaccess] Add memcmp_user()
Michael Brown [Mon, 6 Jan 2014 17:56:58 +0000 (18:56 +0100)] 
[uaccess] Add memcmp_user()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[libc] Add abs()
Michael Brown [Tue, 7 Jan 2014 03:53:56 +0000 (03:53 +0000)] 
[libc] Add abs()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[deflate] Fix literal data length calculation
Michael Brown [Wed, 8 Jan 2014 22:21:23 +0000 (23:21 +0100)] 
[deflate] Fix literal data length calculation

Fix incorrect calculation used to determine length of data to be
copied within a literal data block, and add a test case to prevent
this bug from going undetected in future.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[deflate] Add support for DEFLATE decompression
Michael Brown [Wed, 1 Jan 2014 20:17:26 +0000 (21:17 +0100)] 
[deflate] Add support for DEFLATE decompression

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Add okx() macro taking an explicit file name and line number
Michael Brown [Fri, 3 Jan 2014 23:35:45 +0000 (00:35 +0100)] 
[test] Add okx() macro taking an explicit file name and line number

Allow test reports to specify an explicit file name and line number
using the extended okx() macro.  This allows large blocks of test
report code such as tcpip_random_ok() to be implemented as functions
rather than macros.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[libc] Add isprint()
Michael Brown [Fri, 3 Jan 2014 01:21:52 +0000 (02:21 +0100)] 
[libc] Add isprint()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Build ROMs used by qemu and VMware as part of "make all"
Michael Brown [Thu, 26 Dec 2013 22:36:34 +0000 (23:36 +0100)] 
[build] Build ROMs used by qemu and VMware as part of "make all"

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[ipv6] Fix compilation under FreeBSD
Michael Brown [Sat, 21 Dec 2013 13:21:30 +0000 (13:21 +0000)] 
[ipv6] Fix compilation under FreeBSD

Reported-by: Dewey Hylton <dewey@hyltown.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Remove obsolete check for GNU as version 2.9.1
Michael Brown [Sat, 21 Dec 2013 13:13:46 +0000 (13:13 +0000)] 
[build] Remove obsolete check for GNU as version 2.9.1

Reported-by: Dewey Hylton <dewey@hyltown.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[vesafb] Set "magic" colour to transparent when a background picture is used
Michael Brown [Mon, 9 Dec 2013 15:32:42 +0000 (15:32 +0000)] 
[vesafb] Set "magic" colour to transparent when a background picture is used

Use the magic colour facility to cause the user interface background
to become transparent when we have a background picture.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[console] Add concept of a "magic" colour
Michael Brown [Mon, 9 Dec 2013 15:30:59 +0000 (15:30 +0000)] 
[console] Add concept of a "magic" colour

The magic basic colour can be remapped at runtime from COLOR_NORMAL_BG
(usually blue) to COLOR_DEFAULT (which will be transparent as a
background colour on the framebuffer console).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Add the "colour" and "cpair" commands
Michael Brown [Sun, 8 Dec 2013 01:03:35 +0000 (01:03 +0000)] 
[cmdline] Add the "colour" and "cpair" commands

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[mucurses] Use centralised concept of colour pairs
Michael Brown [Sat, 7 Dec 2013 21:00:09 +0000 (21:00 +0000)] 
[mucurses] Use centralised concept of colour pairs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[console] Add centralised concept of colours and colour pairs
Michael Brown [Sat, 7 Dec 2013 20:53:20 +0000 (20:53 +0000)] 
[console] Add centralised concept of colours and colour pairs

Add a centralised concept of colours and colour pairs (using the
default colour pairs as configured via config/colour.h).  A colour
pair consists of a pair of colour indices.

Add the ability to redefine both a colour pair and an individual
colour index, with minimal overhead if this feature is not required
(e.g. because the relevant shell commands are not present in the
build).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[fbcon] Always draw cursor using current foreground and background colours
Michael Brown [Sun, 8 Dec 2013 01:28:50 +0000 (01:28 +0000)] 
[fbcon] Always draw cursor using current foreground and background colours

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[lkrnprefix] Include iPXE version string in image header
Michael Brown [Fri, 6 Dec 2013 20:11:36 +0000 (20:11 +0000)] 
[lkrnprefix] Include iPXE version string in image header

Originally-implemented-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[fbcon] Update the console width and height after changing mode
Michael Brown [Fri, 6 Dec 2013 17:51:34 +0000 (17:51 +0000)] 
[fbcon] Update the console width and height after changing mode

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[console] Allow consoles to update the recorded console size
Michael Brown [Fri, 6 Dec 2013 17:47:54 +0000 (17:47 +0000)] 
[console] Allow consoles to update the recorded console size

Provide a mechanism for consoles to update the recorded console width
and height, and use this width and height to provide the curses COLS
and LINES variables.

We choose not to use ANSI escape sequences to obtain the width and
height, for two reasons:

- iPXE's model is that all output is sent to all consoles; we could
  therefore end up with multiple consoles reporting conflicting widths
  and heights

- when a serial console is in use, we probably don't want to resize
  the output shown on the BIOS console to match the size of the serial
  console, since it's likely that the serial console is in use only
  for debugging.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Fix LABEL name for .liso images
Christian Hesse [Mon, 2 Dec 2013 12:19:52 +0000 (13:19 +0100)] 
[build] Fix LABEL name for .liso images

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[menu] Adapt user interface to fit display size
Michael Brown [Fri, 6 Dec 2013 17:00:06 +0000 (17:00 +0000)] 
[menu] Adapt user interface to fit display size

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[login] Adapt user interface to fit display size
Michael Brown [Fri, 6 Dec 2013 16:50:43 +0000 (16:50 +0000)] 
[login] Adapt user interface to fit display size

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[settings] Adapt user interface to fit display size
Michael Brown [Fri, 6 Dec 2013 16:44:35 +0000 (16:44 +0000)] 
[settings] Adapt user interface to fit display size

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[vesafb] Work around data corruption bug in bochs/qemu VBE implementation
Michael Brown [Fri, 6 Dec 2013 02:37:36 +0000 (02:37 +0000)] 
[vesafb] Work around data corruption bug in bochs/qemu VBE implementation

The vgabios used by bochs and qemu (and other virtualisation products)
has a bug in its implementation of INT 10,4f00 which causes the high
16 bits of %ebx and %edx to become corrupted.

The vgabios code uses a "pushaw"/"popaw" pair to preserve the low 16
bits of all non-segment registers.  The vgabios code is compiled using
bcc, which generates 8086-compatible code and so never touches the
high 16 bits of the 32-bit registers.  However, the function
vbe_biosfn_return_controller_information() includes the line:

    size_64k = (Bit16u)((Bit32u)cur_info->info.XResolution *
cur_info->info.XResolution *
cur_info->info.BitsPerPixel) >> 19;

which generates an implicit call to the "lmulul" function.  This
function is implemented in vbe.c as:

    ; helper function for memory size calculation
    lmulul:
      and eax, #0x0000FFFF
      shl ebx, #16
      or  eax, ebx
      SEG SS
      mul eax, dword ptr [di]
      mov ebx, eax
      shr ebx, #16
      ret

which modifies %eax, %ebx, and %edx (as a result of the "mul"
instruction, which places its result into %edx:%eax).

Work around this problem by marking %ebx and %edx as being clobbered
by the call to INT 10,4f00.  (%eax is already used as an output
register, so does not need to be on the clobber list.)

Reported-by: Oliver Rath <rath@mglug.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[ipv6] Expose NDP-provided settings (including the DNS server)
Michael Brown [Thu, 5 Dec 2013 16:44:50 +0000 (16:44 +0000)] 
[ipv6] Expose NDP-provided settings (including the DNS server)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[dhcpv6] Add DHCPv6 "filename" setting
Michael Brown [Thu, 5 Dec 2013 15:12:50 +0000 (15:12 +0000)] 
[dhcpv6] Add DHCPv6 "filename" setting

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[settings] Merge SETTING_IPv4 and SETTING_IPv6
Michael Brown [Thu, 5 Dec 2013 15:11:15 +0000 (15:11 +0000)] 
[settings] Merge SETTING_IPv4 and SETTING_IPv6

Allow for equivalent IPv4 and IPv6 settings (which requires equivalent
settings to be adjacent within the settings list).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[settings] Allow for multiple definitions of each predefined setting
Michael Brown [Tue, 19 Nov 2013 15:34:58 +0000 (15:34 +0000)] 
[settings] Allow for multiple definitions of each predefined setting

Allow for multiple setting definitions with the same name but
different scopes and tags.  For example, allow for a "filename"
setting with default scope and tag value 67 (for DHCPv4) and a
corresponding "filename" setting with IPv6 scope and tag value 59 (for
DHCPv6).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[settings] Force settings into alphabetical order within sections
Michael Brown [Thu, 5 Dec 2013 12:38:51 +0000 (12:38 +0000)] 
[settings] Force settings into alphabetical order within sections

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[dhcpv6] Use DUID-UUID form of client DUID
Michael Brown [Thu, 5 Dec 2013 03:18:59 +0000 (03:18 +0000)] 
[dhcpv6] Use DUID-UUID form of client DUID

Use the system UUID to generate the client DUID-UUID as per RFC 6355.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[linux] Provide access to SMBIOS via /dev/mem
Michael Brown [Thu, 5 Dec 2013 03:15:53 +0000 (03:15 +0000)] 
[linux] Provide access to SMBIOS via /dev/mem

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[ipv6] Add support for resolving IPv6 addresses via the "nslookup" command
Michael Brown [Thu, 5 Dec 2013 01:52:34 +0000 (01:52 +0000)] 
[ipv6] Add support for resolving IPv6 addresses via the "nslookup" command

Signed-off-by: Michael Brown <mcb30@ipxe.org>