Michael Brown [Wed, 4 Dec 2013 22:06:10 +0000 (22:06 +0000)]
[settings] Allow for IPv6 setting types in non-IPv6 builds
Allow for the existence of references to IPv6 setting types without
dragging in the whole IPv6 stack, by placing the definition of
setting_type_ipv6 in core/settings.c and providing weak stub methods
for parse_ipv6_setting() and format_ipv6_setting().
Michael Brown [Tue, 3 Dec 2013 16:48:56 +0000 (16:48 +0000)]
[settings] Explicitly separate the concept of a completed fetched setting
The fetch_setting() family of functions may currently modify the
definition of the specified setting (e.g. to add missing type
information). Clean up this interface by requiring callers to provide
an explicit buffer to contain the completed definition of the fetched
setting, if required.
Michael Brown [Mon, 2 Dec 2013 17:20:36 +0000 (17:20 +0000)]
[console] Allow '?' as an intermediate byte in ANSI escape sequences
The ANSI escape sequences to show and hide the cursor take the form
"<ESC>[?25h" and "<ESC>[?25l" respectively. iPXE currently treats the
'?' character as the final byte. Fix by explicitly treating '?' as an
intermediate byte.
Michael Brown [Mon, 2 Dec 2013 15:55:45 +0000 (15:55 +0000)]
[build] Fix building on OpenBSD 5.4
OpenBSD 5.4 seems to generate dynamically linked binaries by default,
which breaks our build process. Fix by forcing the linker to always
create static binaries.
Reported-by: Jiri B <jirib@devio.us> Tested-by: Jiri B <jirib@devio.us> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Michael Brown [Thu, 28 Nov 2013 14:56:25 +0000 (14:56 +0000)]
[vesafb] Select an optimal mode, rather than the first acceptable mode
There is no requirement for VBE modes to be listed in increasing order
of resolution. With the present logic, this can cause e.g. a 1024x768
mode to be selected if the user asks for 640x480, if the 1024x768 mode
is earlier in the mode list.
Define a scoring system for modes as
score = ( width * height - bpp )
and choose the mode with the lowest score among all acceptable modes.
This should prefer to choose the mode closest to the requested
resolution, with a slight preference for higher colour depths.
Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Michael Brown [Thu, 28 Nov 2013 11:41:07 +0000 (11:41 +0000)]
[vesafb] Skip modes for which we cannot get mode information
The VirtualBox BIOS fails to retrieve mode information (with status
0x0100) for some modes within the mode list. Skip any such modes,
rather than treating this as a fatal error.
Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Michael Brown [Thu, 28 Nov 2013 04:15:34 +0000 (04:15 +0000)]
[vesafb] Add VESA frame buffer console
The VESA frame buffer console uses the VESA BIOS extensions (VBE) to
enumerate video modes, selects an appropriate mode, and then hands off
to the generic frame buffer code.
The font is extracted from the VGA BIOS, avoiding the need to provide
an external font file.
Christian Hesse [Wed, 13 Nov 2013 10:46:02 +0000 (11:46 +0100)]
[build] Update build system for Syslinux 6.x
Syslinux 6.x places its files into a bios subdirectory, and requires
that a ldlinux.c32 module be included within the ISO image. Add the
relevant search paths for isolinux.bin, and include the file
ldlinux.c32 within the ISO image if it exists.
Michael Brown [Fri, 8 Nov 2013 14:35:29 +0000 (14:35 +0000)]
[dhcpv6] Add basic support for stateful and stateless DHCPv6
Add support for the stateful and stateless variants of the DHCPv6
protocol. The resulting settings block is registered as
"net<x>.dhcpv6", and DHCPv6 options can be obtained using
e.g. "${net0.dhcpv6/23:ipv6}" to obtain the IPv6 DNS server address.
IPv6 addresses obtained via stateful DHCPv6 are not yet applied to the
network device.
Michael Brown [Fri, 8 Nov 2013 12:45:22 +0000 (12:45 +0000)]
[pxe] Ensure cached DHCPACK is retrieved prior to network device creation
The retrieval of the cached DHCPACK and the creation of network
devices are both currently scheduled as STARTUP_NORMAL. It is
therefore possible that the cached DHCPACK will not be retrieved in
time for cachedhcp_probe() to apply it to the relevant network device.
Fix by retrieving the cached DHCPACK at initialisation time rather
than at startup time.
As an optimisation, an unclaimed cached DHCPACK can be freed
immediately after the last network device has been created, rather
than waiting until shutdown.
Reported-by: Espen Braastad <espen.braastad@redpill-linpro.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Michael Brown [Thu, 7 Nov 2013 14:44:28 +0000 (14:44 +0000)]
[ipv6] Add IPv6 network device configurator
Include IPv6 within the generic network device configurator
mechanism. The IPv6 configurator will send a router solicitation and
wait for a router advertisement to be received. (As per RFC4861
section 6.3.7, we do this even if advertisements have been received
prior to sending the router solicitation.)
Michael Brown [Thu, 31 Oct 2013 15:37:52 +0000 (15:37 +0000)]
[netdevice] Add generic concept of a network device configurator
iPXE supports multiple mechanisms for network device configuration:
DHCPv4 for IPv4, FIP for FCoE, and SLAAC for IPv6. At present, DHCPv4
requires an explicit action (e.g. a "dhcp" command), FIP is initiated
implicitly upon opening a network device, and SLAAC takes place
whenever a RA happens to be received.
Add a generic concept of a network device configurator, which provides
a common interface to triggering configuration and to reporting the
result of the configuration process.
Michael Brown [Tue, 5 Nov 2013 16:58:34 +0000 (16:58 +0000)]
[autoboot] Fix shell banner timeout
Commit 5e1fa5c ("[parseopt] Add parse_timeout()") introduced a
regression causing the shell banner timeout value (calculated in
milliseconds) to be treated as a timer tick count, resulting in a
timeout of approximately two minutes rather than the intended two
seconds.
Reported-by: Christian Hesse <list@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Michael Brown [Fri, 1 Nov 2013 15:05:16 +0000 (15:05 +0000)]
[job] Allow job_progress() to return an ongoing job status code, if known
Some background jobs have a meaningful ongoing status code (e.g. the
current link status for a job waiting for a network link to come up).
Allow this to be exposed via the job_progress() method.
Michael Brown [Fri, 1 Nov 2013 15:52:31 +0000 (15:52 +0000)]
[interface] Default to calling intf_restart() in response to intf_close()
If an object interface does not provide an intf_close() method, then
default to calling intf_restart(). This allows static objects to
safely ignore intf_close(), without needing to add code solely to
ensure that the interface gets unplugged.
Michael Brown [Fri, 1 Nov 2013 02:22:12 +0000 (02:22 +0000)]
[parseopt] Add parse_timeout()
Parsing a timeout value (specified in milliseconds) into an internal
timeout value measured in timer ticks is a common operation. Provide
a parse_timeout() value to carry out this conversion automatically.
Michael Brown [Fri, 25 Oct 2013 16:24:09 +0000 (17:24 +0100)]
[pxe] Always retrieve cached DHCPACK and apply to relevant network device
When chainloading, always retrieve the cached DHCPACK packet from the
underlying PXE stack, and apply it as the original contents of the
"net<X>.dhcp" settings block. This allows cached DHCP settings to be
used for any chainloaded iPXE binary (not just undionly.kkpxe).
This change eliminates the undocumented "use-cached" setting. Issuing
the "dhcp" command will now always result in a fresh DHCP request.
Michael Brown [Fri, 25 Oct 2013 13:41:37 +0000 (14:41 +0100)]
[ipv6] Automatically choose source for link-local and multicast destinations
When transmitting to a link-local or multicast destination address,
use the network device's link-local address as the source address if
no explicit source address has been specified.
Michael Brown [Mon, 21 Oct 2013 13:17:47 +0000 (14:17 +0100)]
[ping] Add generic ping mechanism
Add generic pinger mechanism (analogous to the generic downloader
mechanism) which opens a ping socket, transmits ping requests, and
passes information about ping replies to a callback function.
Michael Brown [Mon, 21 Oct 2013 13:10:07 +0000 (14:10 +0100)]
[icmp] Add support for sending ICMP echo requests
Merge common functionality between IPv4 and IPv6 ICMP echo handling,
and add support for transmitting ICMP echo requests and delivering
ICMP echo replies to a (not yet implemented) ping_rx() function.
Michael Brown [Wed, 25 Sep 2013 11:55:46 +0000 (12:55 +0100)]
[build] Work around bug in gcc >= 4.8
Commit 238050d ("[build] Work around bug in gcc >= 4.8") works around
one instance of a bug in recent versions of gcc, in which "ebp" cannot
be specified within an asm clobber list.
Some versions of gcc seem to exhibit the same bug on other points in
the codebase. Fix by changing all instances of "ebp" in a clobber
list to use the push/pop %ebp workaround instead.
Originally-implemented-by: Víctor Román Archidona <contacto@victor-roman.es> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Michael Brown [Wed, 4 Sep 2013 16:37:34 +0000 (17:37 +0100)]
[tcp] Reduce path MTU to 1280 bytes
The path MTU is currently hardcoded to 1460 bytes, which fails to
allow space for TCP options. Sending a maximum-sized datagram (which
is viable when using HTTP POST) will therefore fail since the Ethernet
MTU will be exceeded.
Reduce the hardcoded path MTU to produce a maximum datagram of 1280
bytes, which is the size required of data link layers by IPv6. It is
a reasonable assumption that all intermediary data link layers will be
able to convey this packet without fragmentation, even for IPv4.
Note that this reduction has a minimal impact upon download
throughput, since it affects only the transmit data path.
Originally-fixed-by: Suresh Sundriyal <ssundriy@vmware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Michael Brown [Mon, 26 Aug 2013 13:23:54 +0000 (14:23 +0100)]
[ipv6] Replace IPv6 stack
Replace the existing partially-implemented IPv6 stack with a fresh
implementation.
This implementation is not yet complete. The IPv6 transmit and
receive datapaths are functional (including fragment reassembly and
parsing of arbitrary extension headers). NDP neighbour solicitations
and advertisements are supported. ICMPv6 echo is supported.
At present, only link-local addresses may be used, and there is no way
to specify an IPv6 address as part of a URI (either directly or via
a DNS lookup).
Michael Brown [Sun, 1 Sep 2013 15:13:58 +0000 (16:13 +0100)]
[neighbour] Generalise concept of neighbour discovery
Split the protocol-independent portions of arp.c into a separate file
neighbour.c, to allow for sharing of functionality between IPv4+ARP
and IPv6+NDP.
Michael Brown [Thu, 29 Aug 2013 13:10:16 +0000 (14:10 +0100)]
[netdevice] Add concept of a network device index
IPv6 link-local socket addresses require some way to specify a local
network device. We cannot simply use a pointer to the network device,
since a struct sockaddr_in6 may be long-lived and has no way to hold a
reference to the network device.
Using a network device index allows a socket address to cleanly refer
to a network device without worrying about whether or not that device
continues to exist.
Michael Brown [Tue, 27 Aug 2013 15:28:54 +0000 (16:28 +0100)]
[linux] Give tap devices a name and bus type
Give tap devices a meaningful name, and avoid segmentation faults when
attempting to retrieve ${net0/bustype} by assigning a new bus type for
tap devices.
Michael Brown [Wed, 14 Aug 2013 14:07:52 +0000 (15:07 +0100)]
[uri] Allow URIs to incorporate a parameter list
HTTP POST requires the ability to associate a parameter list with a
URI. There is no standardised syntax for this. Use a non-standard
URI syntax to incorporate the specification of a parameter list within
a URI:
URI = [ absoluteURI | relativeURI ]
[ "#" fragment ] [ "##params" [ "=" paramsName ] ]