people/meteger/gpxe.git
7 years ago[ipv6] Verify destination address in ICMP6 and ensure I/O buffer is freed master
Matthew Iselin [Tue, 19 Jul 2011 12:38:19 +0000 (22:38 +1000)]
[ipv6] Verify destination address in ICMP6 and ensure I/O buffer is freed

Previously gPXE would happily respond to any ICMP6 echo packet sent on
the network, regardless of whether that packet was addressed to it or
not. This will stop that from happening.

Also, the previous handling would not free the passed I/O buffer; this
has been fixed in this commit.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Check for a valid destination address in ipv6_rx
Matthew Iselin [Mon, 25 Jul 2011 00:40:02 +0000 (10:40 +1000)]
[ipv6] Check for a valid destination address in ipv6_rx

Previously, gPXE would happily process any IPv6 packet transmitted to
it, even if it was not targeted to the gPXE station. This caused
issues with ICMPv6 echo requests in particular, but also wasted
processing time on other traffic on the network.

Now, the destination address is verified before too much processing is done.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Rework option handling and implement IPv6 fragment reassembly
Matthew Iselin [Thu, 21 Jul 2011 01:13:37 +0000 (11:13 +1000)]
[ipv6] Rework option handling and implement IPv6 fragment reassembly

gPXE will now traverse the list of extension headers in an IPv6
packet, rather than simply using the "Next Header" field of the IPv6
header. There are a lot of options that we can simply ignore for now
in gPXE, but they are ready for implementation.

The definitions of the extension header identifiers has been fixed to
use the correct values as well.

IP6 fragment reassembly is also implemented, with an adjusted
mechanism for checksum calculation to ensure the entire packet is
checksummed properly.  The reassembly of fragments is essentially a
direct port from IPv4, with minor changes.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Change return code handling from router solicits
Matthew Iselin [Mon, 18 Jul 2011 01:20:15 +0000 (11:20 +1000)]
[ipv6] Change return code handling from router solicits

Using 'rc' for flags causes "Error <code>" to be displayed when monojob_wait
completes, which is not very user-friendly. By adding the flags to struct
rsolicit_info we can pass this information around without having to special-case
return code handling.

DHCPv6 has been updated accordingly, and has also been updated to take a
pointer to a struct rsolicit_info, which reduces the number of duplicate
solicitations we do in a normal startup sequence.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Rework option parsing for router solicitation and neighbour advertisement...
Matthew Iselin [Mon, 18 Jul 2011 00:59:39 +0000 (10:59 +1000)]
[ipv6] Rework option parsing for router solicitation and neighbour advertisement handling

Instead of using an "offset" variable, use iob_pull and iob_len to
retrieve options from the packet buffer.

Also, neighbour advertisements no longer assume anything about the
layout of the packet that has been received. Previously, if any other
option was present before the link-layer address, the assertions would
fail and the packet would be ignored. Now, the option list is
traversed and the correct options are used as necessary.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Attempt DHCPv6 only in specific circumstances
Matthew Iselin [Sun, 17 Jul 2011 05:36:20 +0000 (15:36 +1000)]
[ipv6] Attempt DHCPv6 only in specific circumstances

We should try DHCPv6 only if a router advertisement is never received,
or if a received router advertisement suggests getting extra or all
information from a DHCPv6 server on the network.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix dhcp6 to detect error conditions with router solicits
Matthew Iselin [Sun, 17 Jul 2011 05:35:05 +0000 (15:35 +1000)]
[ipv6] Fix dhcp6 to detect error conditions with router solicits

Make rc > 0 an error condition for router solicits.

Handle a case where configuration information from a DHCPv6 router
advertisement has either the OTHERCONF or MANAGED flags set.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix router solicitation struct and flag checking
Matthew Iselin [Sun, 17 Jul 2011 05:34:05 +0000 (15:34 +1000)]
[ipv6] Fix router solicitation struct and flag checking

The original layout of the router advertisement struct for parsing
incoming packets was incorrect, and the definitions of the flags we
checked was invalid. Change this to use the right position for
each field so that flag checking works properly.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Handle the "no router" case properly in DHCPv6
Matthew Iselin [Sun, 17 Jul 2011 04:43:21 +0000 (14:43 +1000)]
[ipv6] Handle the "no router" case properly in DHCPv6

Assign a proper /128 and do better failure detection when sending a
router solicitation.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Enable router solicitations to timeout
Matthew Iselin [Sun, 17 Jul 2011 04:42:40 +0000 (14:42 +1000)]
[ipv6] Enable router solicitations to timeout

This change enables gPXE to timeout on networks where a router
advertisement daemon is not active.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Modify router solicits to provide metadata
Matthew Iselin [Sat, 16 Jul 2011 12:38:27 +0000 (22:38 +1000)]
[ipv6] Modify router solicits to provide metadata

This patch allows router solicitation to return extra data to the
requestor, if requested, which allows DHCPv6 to assign a fully
routable address for use later.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Use /64 for link-local instead of /10
Matthew Iselin [Sat, 16 Jul 2011 12:37:06 +0000 (22:37 +1000)]
[ipv6] Use /64 for link-local instead of /10

Linux uses a /64 prefix for their link-local addresses, instead of the
"standard" /10. This makes comparing link-local addresses easier and
in particular avoids the case where the link-local prefix straddles a
byte boundary.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix multicast routing in some conditions
Matthew Iselin [Sat, 16 Jul 2011 12:35:25 +0000 (22:35 +1000)]
[ipv6] Fix multicast routing in some conditions

Also, change error handling in the settings applicator.

This will fix routing for multicast addresses when only link-local
addresses are available, which is common on networks where router
advertisements only provide routing information, and are not used
for address autoconfiguration.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Implement DHCPv6 (RFC3315)
Matthew Iselin [Mon, 4 Jul 2011 10:33:19 +0000 (20:33 +1000)]
[ipv6] Implement DHCPv6 (RFC3315)

This implementation supports rapid commits, conventional DHCPv6
transactions, and information-only requests.

This is not a complete implementation of RFC3315, but rather an
implementation of the features that are meaningful to gPXE as a
network boot client.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[settings] Support IPv6 addresses and allow IPv6 nameservers in DNS
Matthew Iselin [Sat, 16 Jul 2011 11:11:00 +0000 (21:11 +1000)]
[settings] Support IPv6 addresses and allow IPv6 nameservers in DNS

This will allow DHCPv6 to assign DNS nameservers for lookups.
I have chosen to allow DNS to perform lookups to either an IPv6 server
or an IPv4 server to avoid adding too much IPv6-dependent code to DNS.

When assigning an IPv6 address via the "ip6" setting, note that for most
uses a routable prefix (eg, 64) and gateway must be provided as well.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Add dhcp6 types and constants
Matthew Iselin [Mon, 27 Jun 2011 09:12:37 +0000 (19:12 +1000)]
[ipv6] Add dhcp6 types and constants

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Clean up inet6_ntoa
Matthew Iselin [Mon, 27 Jun 2011 09:02:27 +0000 (19:02 +1000)]
[ipv6] Clean up inet6_ntoa

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Make router solicits block until complete
Matthew Iselin [Sat, 25 Jun 2011 02:45:11 +0000 (12:45 +1000)]
[ipv6] Make router solicits block until complete

Also return a status code to the caller

Note: does not yet time out if no router advertisements are received.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix IPv6 checksum psuedo-header creation
Matthew Iselin [Wed, 22 Jun 2011 11:08:46 +0000 (21:08 +1000)]
[ipv6] Fix IPv6 checksum psuedo-header creation

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Use ipv6_tx instead of tcpip_tx in icmp6
Matthew Iselin [Fri, 17 Jun 2011 11:51:21 +0000 (21:51 +1000)]
[ipv6] Use ipv6_tx instead of tcpip_tx in icmp6

This change is designed to maintain consistency with the RX path.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Handle unaligned prefixes in router advertisements
Matthew Iselin [Wed, 8 Jun 2011 03:30:54 +0000 (13:30 +1000)]
[ipv6] Handle unaligned prefixes in router advertisements

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Add a dedicated function for prefix matching
Matthew Iselin [Wed, 8 Jun 2011 03:30:25 +0000 (13:30 +1000)]
[ipv6] Add a dedicated function for prefix matching

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Implement EUI-64 generation as a function
Matthew Iselin [Wed, 8 Jun 2011 03:20:49 +0000 (13:20 +1000)]
[ipv6] Implement EUI-64 generation as a function

Update NDP and ip6mgmt accordingly

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix formatting in ndp_process_radvert
Matthew Iselin [Sat, 4 Jun 2011 02:25:51 +0000 (12:25 +1000)]
[ipv6] Fix formatting in ndp_process_radvert

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Update the NDP cache when receiving a router advertisement
Matthew Iselin [Sat, 4 Jun 2011 02:20:52 +0000 (12:20 +1000)]
[ipv6] Update the NDP cache when receiving a router advertisement

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Handle netdev parameter being non-null in ipv6_tx
Matthew Iselin [Sat, 4 Jun 2011 02:10:38 +0000 (12:10 +1000)]
[ipv6] Handle netdev parameter being non-null in ipv6_tx

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Implement router solicitations and integrate with the "ipv6" command
Matthew Iselin [Sat, 4 Jun 2011 02:10:23 +0000 (12:10 +1000)]
[ipv6] Implement router solicitations and integrate with the "ipv6" command

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[dns] Handle AAAA records
Matthew Iselin [Thu, 2 Jun 2011 13:14:57 +0000 (23:14 +1000)]
[dns] Handle AAAA records

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Verify validity of IPv6 address in inet6_aton
Matthew Iselin [Thu, 2 Jun 2011 13:14:37 +0000 (23:14 +1000)]
[ipv6] Verify validity of IPv6 address in inet6_aton

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Make IPv6 routing work with addresses not on local network
Matthew Iselin [Thu, 2 Jun 2011 11:51:58 +0000 (21:51 +1000)]
[ipv6] Make IPv6 routing work with addresses not on local network

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix inet6_aton and remove some unnecessary debugging
Matthew Iselin [Wed, 1 Jun 2011 13:03:59 +0000 (23:03 +1000)]
[ipv6] Fix inet6_aton and remove some unnecessary debugging

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Implement handling of neighbour solicit messages
Matthew Iselin [Wed, 1 Jun 2011 12:13:30 +0000 (22:13 +1000)]
[ipv6] Implement handling of neighbour solicit messages

Implement handling of neighbour solicit messages and improve handling
of neighbour advert messages.

Also:

  - Add handling of ICMPv6 echoes, mostly for debugging
  - Implement router advertisement handling for autoconfiguration

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Enable ICMPv6 protocols to check addresses against network devices
Matthew Iselin [Wed, 1 Jun 2011 11:45:44 +0000 (21:45 +1000)]
[ipv6] Enable ICMPv6 protocols to check addresses against network devices

Add a net_protocol so that ICMPv6 protocols can check IPv6 addresses
against network devices.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Call icmp6_rx directly from ipv6.c
Matthew Iselin [Wed, 8 Jun 2011 12:31:33 +0000 (22:31 +1000)]
[ipv6] Call icmp6_rx directly from ipv6.c

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[uri] Make URI parsing handle IPv6_address:port
Matthew Iselin [Mon, 30 May 2011 12:30:51 +0000 (22:30 +1000)]
[uri] Make URI parsing handle IPv6_address:port

For example:

    http://[fc00::1]:1234

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix icmp6 neighbour solicit multicast address creation
Matthew Iselin [Mon, 30 May 2011 12:29:37 +0000 (22:29 +1000)]
[ipv6] Fix icmp6 neighbour solicit multicast address creation

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix link-local and local network routing in ipv6_tx
Matthew Iselin [Mon, 30 May 2011 12:28:12 +0000 (22:28 +1000)]
[ipv6] Fix link-local and local network routing in ipv6_tx

This has broken stuff because gPXE doesn't yet respond to neighbour
solicits itself, and it's now possible to have several IPv6 addresses
on a live gPXE instance.

As such, expect TCP (over IPv6) timeouts and such after this commit.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Fix formatting on a DBG line
Matthew Iselin [Mon, 30 May 2011 12:25:43 +0000 (22:25 +1000)]
[ipv6] Fix formatting on a DBG line

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[tcp] Enable AF_INET6 transport for tcp connections
Matthew Iselin [Mon, 30 May 2011 07:11:53 +0000 (17:11 +1000)]
[tcp] Enable AF_INET6 transport for tcp connections

Now that IPv6 is somewhat usable, enable AF_INET6 transport for tcp
connections.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[uri] Make URI parsing handle IPv6 addresses
Matthew Iselin [Thu, 26 May 2011 11:27:47 +0000 (21:27 +1000)]
[uri] Make URI parsing handle IPv6 addresses

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Implement inet6_aton, numeric IPv6 address resolution
Matthew Iselin [Thu, 26 May 2011 11:27:14 +0000 (21:27 +1000)]
[ipv6] Implement inet6_aton, numeric IPv6 address resolution

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Add function prototype for inet6_ntoa
Matthew Iselin [Mon, 30 May 2011 07:11:34 +0000 (17:11 +1000)]
[ipv6] Add function prototype for inet6_ntoa

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Modify "ipv6" command to set an IPv6 address on an interface
Matthew Iselin [Thu, 26 May 2011 08:44:54 +0000 (18:44 +1000)]
[ipv6] Modify "ipv6" command to set an IPv6 address on an interface

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Make inet6_ntoa handle all-zero addresses properly
Matthew Iselin [Thu, 26 May 2011 08:43:21 +0000 (18:43 +1000)]
[ipv6] Make inet6_ntoa handle all-zero addresses properly

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Add "ipv6" command to perform stateless autoconfiguration
Matthew Iselin [Tue, 24 May 2011 10:53:00 +0000 (20:53 +1000)]
[ipv6] Add "ipv6" command to perform stateless autoconfiguration

This command performs stateless autoconfiguration on a given network
interface. It does not yet assign the address to the netdevice.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[igb] Remove __BIG_ENDIAN conditional
Thomas Miletich [Sun, 10 Jul 2011 15:47:09 +0000 (17:47 +0200)]
[igb] Remove __BIG_ENDIAN conditional

Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Implemented zero-compression in inet6_ntoa and fixed IPv6 packet RX
Matthew Iselin [Wed, 27 Apr 2011 09:34:18 +0000 (19:34 +1000)]
[ipv6] Implemented zero-compression in inet6_ntoa and fixed IPv6 packet RX

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Make IPv6 configuration option disabled by default
Marty Connor [Tue, 5 Jul 2011 15:01:37 +0000 (11:01 -0400)]
[ipv6] Make IPv6 configuration option disabled by default

For testing, adding the line:

   #define NET_PROTO_IPV6

to the file:

   src/config/local/general.h

should enable this option.

Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[ipv6] Add IPv6 configuration option
Matthew Iselin [Wed, 27 Apr 2011 09:28:11 +0000 (19:28 +1000)]
[ipv6] Add IPv6 configuration option

In preparation for adding IPv6 code to gPXE we create the
NET_PROTO_IPV6 configuration option, disabled by default.

Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[3c90x] Clean up reset code
Thomas Miletich [Tue, 1 Feb 2011 22:08:45 +0000 (23:08 +0100)]
[3c90x] Clean up reset code

Removes duplicate hardware resets, remove network interface logic reset.

This also fixes a bug where some 3c905C variants would return bogus
EEPROM values because of a too short delay after the network reset.

Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Reported-by: Peter Huewe <peterhuewe@gmx.de>
Tested-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Marty Connor <mdc@etherboot.org>
7 years ago[3c90x] More fine-grained debugging levels
Thomas Miletich [Tue, 1 Feb 2011 22:08:44 +0000 (23:08 +0100)]
[3c90x] More fine-grained debugging levels

DBG is reserved for errors and important warnings only.
DBG2 for additional information, e.g. "received packet".
DBGP is used to print the name of every function as it is called.

Signed-off-by: Thomas Miletich<thomas.miletich@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[eepro100] Add new PCI ID 8086:27dc
Marty Connor [Mon, 30 Aug 2010 14:24:51 +0000 (10:24 -0400)]
[eepro100] Add new PCI ID 8086:27dc

Add PCI ID 8086:27dc to the eepro100 driver.

Reported-by: Cédric Delmas <c.delmas@akka.eu>
Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[compiler] Prevent empty weak function stubs from being removed
Joshua Oreman [Wed, 18 Aug 2010 23:37:22 +0000 (16:37 -0700)]
[compiler] Prevent empty weak function stubs from being removed

Even with the noinline specifier added by commit 1a260f8, gcc may
skip calls to non-inlinable functions that it knows have no side
effects. This caused the get_cached_dhcpack() call in start_dhcp(),
the weak stub of which has no code in its body, to be removed,
preventing cached DHCP from working.

Fix by adding a __keepme macro to compiler.h expanding to asm(""),
as recommended by gcc's info page, and using it in the weak stub
for get_cached_dhcpack().

Reported-by: Aaron Brooks <aaron@brooks1.net>
Tested-by: Aaron Brooks <aaron@brooks1.net>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
8 years ago[dhcp] Allow multiple interfaces in dhcp command
Lars Kellogg-Stedman [Sat, 31 Jul 2010 08:20:41 +0000 (09:20 +0100)]
[dhcp] Allow multiple interfaces in dhcp command

The "dhcp" command now accepts a list of interfaces and to try until one
succeeds:

 gPXE> dhcp net0 net1 net2

If an interface does not exist a message is printed and it is skipped.

If given the single parameter "any" as an interface name, all interfaces
are tried in a manner similar to autoboot:

 gPXE> dhcp any
 DHCP (net0 xx:xx:xx:xx:xx:xx)........ Connection timed out (...)
 Could not configure net0: Connection timed out (...)
 DHCP (net1 xx:xx:xx:xx:xx:xx).... ok
 gPXE>

Note that interfaces which fail to DHCP are closed.  This is usually
desirable since an open interface consumes memory.  On machines with
several interfaces it is possible to exhaust the heap if all interfaces
are open simultaneously.  This behavior differs from the previous "dhcp"
command implementation but should not be detectable to user scripts
since they abort when the dhcp command exits with an error.

Acked-by: Marty Connor <mdc@etherboot.org>
Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[tcp] Allow out-of-order receive queue to be discarded
Michael Brown [Wed, 21 Jul 2010 11:01:50 +0000 (12:01 +0100)]
[tcp] Allow out-of-order receive queue to be discarded

Allow packets in the receive queue to be discarded in order to free up
memory.  This avoids a potential deadlock condition in which the
missing packet can never be received because the receive queue is
occupying all of the memory available for further RX buffers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[malloc] Add cache discard mechanism
Michael Brown [Wed, 21 Jul 2010 10:58:50 +0000 (11:58 +0100)]
[malloc] Add cache discard mechanism

Add a facility allowing cached data to be discarded in order to
satisfy memory allocations that would otherwise fail.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Fix a 64bit compile time error
Piotr Jaroszyński [Thu, 22 Jul 2010 20:10:40 +0000 (22:10 +0200)]
[tcp] Fix a 64bit compile time error

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Handle out-of-order received packets
Michael Brown [Tue, 20 Jul 2010 22:17:30 +0000 (23:17 +0100)]
[tcp] Handle out-of-order received packets

Maintain a queue of received packets, so that lost packets need not
result in retransmission of the entire TCP window.

Increase the TCP window to 8kB, in order that we can potentially
transmit enough duplicate ACKs to trigger Fast Retransmission at the
sender.

Using a 10MB HTTP download in qemu-kvm with an artificial drop rate of
1 in 64 packets, this reduces the download time from around 26s to
around 4s.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Treat ACKs as sent only when successfully transmitted
Michael Brown [Thu, 15 Jul 2010 18:33:46 +0000 (19:33 +0100)]
[tcp] Treat ACKs as sent only when successfully transmitted

gPXE currently forces sending (i.e. sends a pure ACK even in the
absence of fresh data to send) only in response to packets that
consume sequence space or that lie outside of the receive window.
This ignores the possibility that a previous ACK was not actually sent
(due to, for example, the retransmission timer running).

This does not cause incorrect behaviour, but does cause unnecessary
retransmissions from our peer.  For example:

 1. Peer sends final data packet (ack      106 seq 521..523)
 2. We send FIN                  (seq 106..107 ack      523)
 3. Peer sends FIN               (ack      106 seq 523..524)
 4. We send nothing since retransmission timer is running for our FIN
 5. Peer ACKs our FIN            (ack      107 seq 524..524)
 6. We send nothing since this packet consumes no sequence space
 7. Peer retransmits FIN         (ack      107 seq 523..524)
 8. We ACK peer's FIN            (seq 107..107 ack      524)

What should happen at step (6) is that we should ACK the peer's FIN,
since we can deduce that we have never sent this ACK.

Fix by maintaining an "ACK pending" flag that is set whenever we are
made aware that our peer needs an ACK (whether by consuming sequence
space or by sending a packet that appears out of order), and is
cleared only when the ACK packet has been transmitted.

Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Merge boolean flags into a single "flags" field
Michael Brown [Thu, 15 Jul 2010 18:15:36 +0000 (19:15 +0100)]
[tcp] Merge boolean flags into a single "flags" field

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Modified-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Use a dedicated timer for the TIME_WAIT state
Michael Brown [Thu, 15 Jul 2010 17:57:34 +0000 (18:57 +0100)]
[tcp] Use a dedicated timer for the TIME_WAIT state

gPXE currently repurposes the retransmission timer to hold the TCP
connection in the TIME_WAIT state (i.e. waiting for up to 2*MSL in
case we are required to re-ACK our peer's FIN due to a lost ACK).
However, the fact that this timer is running will prevent such an ACK
from ever being sent, since the logic in tcp_xmit() assumes that a
running timer indicates that we ourselves are waiting for an ACK and
so blocks the transmission.  (We always wait for an ACK before sending
our next packet, to keep our transmit data path as simple as
possible.)

Fix by using an entirely separate timer for the TIME_WAIT state, so
that packets can still be sent.

Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[hci] Continue processing while prompting for shell banner
Guo-Fu Tseng [Tue, 13 Jul 2010 13:18:47 +0000 (21:18 +0800)]
[hci] Continue processing while prompting for shell banner

Currently we do nothing while polling for user input in shell_banner.
This commit modifies shell_bannder to do something similar to what is
done in shell, where we schedule processes while waiting for user
input.

This approach provides two potential improvements:

First:
We increase key responsiveness in shell_banner. It is much more
likely to successfully get into shell than before. Before this
change I sometimes pressed the CTRL_B, but failed to get into
shell. It may have been caused by waiting too long in
mdelay(100).

Second:
When using scripts, if the downloaded image is not bootable,
gPXE exits before it has the opportunity to gracefully close
the TCP connection. This can leave the TCP state of a remote
server as not closed when it should have been.

gPXE waits for user to input for 2 seconds by default before
returning control to BIOS. This commit lets TCP have the
opportunity to gracefully close while waiting for the user to
hit keys in shell_banner.

Referenced: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Commit-message-modified-by: Marty Connor <mdc@etherboot.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[cmdline] Fix inconsistent and ugly code formatting in shell_banner()
Michael Brown [Wed, 14 Jul 2010 10:17:26 +0000 (11:17 +0100)]
[cmdline] Fix inconsistent and ugly code formatting in shell_banner()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Modified-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Randomize TCP bind port
Guo-Fu Tseng [Tue, 13 Jul 2010 13:16:26 +0000 (21:16 +0800)]
[tcp] Randomize TCP bind port

This changes is intended to reduce possible TCP port collisions.

Reviewed-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Fix typos by changing ntohl() to htonl() where appropriate
Michael Brown [Tue, 13 Jul 2010 16:18:48 +0000 (17:18 +0100)]
[tcp] Fix typos by changing ntohl() to htonl() where appropriate

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Store local port in host byte order
Michael Brown [Tue, 13 Jul 2010 16:15:57 +0000 (17:15 +0100)]
[tcp] Store local port in host byte order

Every other scalar integer value in struct tcp_connection is in host
byte order; change the definition of local_port to match.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[tcp] Update received sequence number before delivering received data
Michael Brown [Fri, 21 May 2010 23:45:49 +0000 (00:45 +0100)]
[tcp] Update received sequence number before delivering received data

gPXE currently updates the TCP sequence number after delivering the
data to the application via xfer_deliver_iob().  If the application
responds to the received data by transmitting more data, this would
result in a stale ACK number appearing in the transmitted packet,
which potentially causes retransmissions and also gives the
undesirable appearance of violating causality (by sending a response
to a message that we claim not to have yet received).

Reported-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
8 years ago[comboot] Run com32 programs with a valid IDT
Geoff Lywood [Wed, 7 Jul 2010 22:35:01 +0000 (15:35 -0700)]
[comboot] Run com32 programs with a valid IDT

COM32 binaries generally expect to run with interrupts enabled. Syslinux does
so, and COM32 programs will execute cli/sti pairs when running a critical
section, to provide mutual exclusion against BIOS interrupt handlers.
Previously, under gPXE, the IDT was not valid, so any interrupt (e.g. a timer
tick) would generally cause the machine to triple fault.

This change introduces code to:
- Create a valid IDT at the same location that syslinux uses
- Create an "interrupt jump buffer", which contains small pieces of code that
  simply record the vector number and jump to a common handler
- Thunk down to real mode and execute the BIOS's interrupt handler whenever
  an interrupt is received in a COM32 program
- Switch IDTs and enable/disable interrupts when context switching to and from
  COM32 binaries

Testing done:
- Booted VMware ESX using a COM32 multiboot loader (mboot.c32)
- Built with GDBSERIAL enabled, and tested breakpoints on int22 and com32_irq
- Put the following code in a COM32 program:
    asm volatile ( "sti" );
    while ( 1 );
  Before this change, the machine would triple fault immediately. After this
  change, it hangs as expected. Under Bochs, it is possible to see the
  interrupt handler run, and the current time in the BIOS data area gets
  incremented.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[efi] Fix the 32-bit version of elf2efi64
Geoff Lywood [Wed, 21 Jul 2010 02:23:02 +0000 (19:23 -0700)]
[efi] Fix the 32-bit version of elf2efi64

Currently, if elf2efi.c is compiled using a 32-bit HOST_CC, then the
resulting elf2efi64 binary will generate 32-bit EFI binaries instead of
64-bit EFI binaries.

The problem is, elf2efi.c uses the MDE_CPU_* definitions to decide
whether to output a 32-bit or 64-bit PE binary. However, MDE_CPU_* gets
defined in ProcessorBind.h, depending on the compiler's target
architecture. Overriding them on the command line doesn't work in the
expected way, and you can end up in cases where both MDE_CPU_IA32 and
MDE_CPU_X64 are defined.

The patch below should fix the problem. I tested this patch by building
with all 4 combinations of 32- and 64-bit toolchains, targeting both 32-
and 64-bit EFI. In each case, I used objdump to verify that the file
format of bin-*-efi/snponly.efi matched what was expected. I also booted
the 64-bit executable that was generated using the 32-bit toolchain.

Signed-off-by: Geoff Lywood <glywood@vmware.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[forcedeth] Replace driver with native gPXE driver
Andrei Faur [Thu, 29 Jul 2010 20:36:14 +0000 (23:36 +0300)]
[forcedeth] Replace driver with native gPXE driver

This patch adds a native gPXE forcedeth driver and removes the legacy
Etherboot forcedeth driver. It supports 40 different chips, compared
to the original 14.

It has been tested on a NIC with an CK804 Ethernet Controller, and
the results of downloading 5 100mb images in a row have been: 12/11/11/11/11
seconds; booting DSL using pxelinux also succeeded. The driver has also
been tested by chaining undionly.kpxe and it worked.

Signed-off-by: Andrei Faur <da3drus@gmail.com>
Tested-by: Andrei Faur <da3drus@gmail.com>
Tested-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[string] Use 64-bit registers in assembly memswap() on x86_64
Joshua Oreman [Fri, 30 Jul 2010 16:52:03 +0000 (09:52 -0700)]
[string] Use 64-bit registers in assembly memswap() on x86_64

An assembly version of memswap() is in an x86 word-length-agnostic
header file, but it used 32-bit registers to store pointers, leading
to memory errors responding to ARP queries on 64-bit systems.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
8 years ago[802.11] Fix a use-after-free
Joshua Oreman [Fri, 30 Jul 2010 03:13:31 +0000 (20:13 -0700)]
[802.11] Fix a use-after-free

When we received an encrypted packet, after replacing it with its decrypted
version and freeing the encrypted original, we would continue to look at
the header of the now-freed original packet. Fix by moving the header pointer
to point at the decrypted packet instead.

8 years ago[802.11] Use correct name for sec80211_detect()
Joshua Oreman [Fri, 30 Jul 2010 03:12:35 +0000 (20:12 -0700)]
[802.11] Use correct name for sec80211_detect()

The workhorse function for detecting 802.11 security was still named
_sec80211_detect(), a holdover from the old style of weak function
handling, with the result that all networks would be identified as
"unknown".

8 years ago[settings] Unregister the children when unregistering the parent
Piotr Jaroszyński [Wed, 14 Jul 2010 20:25:55 +0000 (22:25 +0200)]
[settings] Unregister the children when unregistering the parent

The DHCP settings registered as a child of the netdevice settings are
not unregistered anywhere.  This prevents the netdevice from being
freed on shutdown.

Fix by automatically unregistering any child settings when the parent
settings are unregistered.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
8 years ago[virtio] Replace virtio-net with native gPXE driver
Stefan Hajnoczi [Fri, 2 Jul 2010 18:15:47 +0000 (19:15 +0100)]
[virtio] Replace virtio-net with native gPXE driver

This patch adds a native gPXE virtio-net driver and removes the legacy
Etherboot virtio-net driver.  The main reasons for doing this are:

1. Multiple virtio-net NICs are now supported by gPXE.  The legacy
   driver kept global state and caused issues in virtual machines with
   more than one virtio-net device.

2. Faster downloads.  The native gPXE driver downloads 100 MB over HTTP
   in 12s, the legacy Etherboot driver in 37s.  This simple benchmark
   uses KVM with tap networking and the Python SimpleHTTPServer both
   running on the same host.

Changes to core virtio code reduce vring descriptors to 256 (QEMU uses
128 for virtio-blk and 256 for virtio-net) and change the opaque token
from u16 to void*.  Lowering the descriptor count reduces memory
consumption.  The void* opaque token change makes driver code simpler.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[errcode] Remove unused contrib/errcode scripts
Stefan Hajnoczi [Sun, 11 Jul 2010 07:52:57 +0000 (08:52 +0100)]
[errcode] Remove unused contrib/errcode scripts

The new errdb error code database is more accurate than the regular
expression-based errcode scripts.  This patch removes errcode scripts in
favor of errdb.

The gpxebot.py script is no longer needed, gpxebot has been released as
a separate open source codebase:

  http://git.etherboot.org/?p=people/stefanha/gpxebot.git;a=summary

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[compiler] Mark weak functions noinline
Stefan Hajnoczi [Wed, 14 Jul 2010 07:32:48 +0000 (08:32 +0100)]
[compiler] Mark weak functions noinline

Weak functions whose visibility is hidden may be inlined due to a bug in
GCC.  Explicitly mark weak functions noinline to work around the
problem.

This makes the PXE_MENU config option work again, the PXE boot menu was
never being called because the compiler inlined a weak stub function.

The GCC bug was identified and fixed by Richard Sandiford
<rdsandiford@googlemail.com> but in the meantime gPXE needs to implement
a workaround.

Reported-by: Steve Jones <steve@squaregoldfish.co.uk>
Reported-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Suggested-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[image] Fix a memleak in free_image()
Piotr Jaroszyński [Thu, 8 Jul 2010 13:54:55 +0000 (15:54 +0200)]
[image] Fix a memleak in free_image()

image_set_cmdline() strdup()s cmdline, which free_image() doesn't clean
up.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[tcp] Fix potential use-after-free when accessing timestamp option
Michael Brown [Wed, 7 Jul 2010 11:57:08 +0000 (12:57 +0100)]
[tcp] Fix potential use-after-free when accessing timestamp option

Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[refcnt] Fix embedded image building
Alessandro Salvatori [Mon, 5 Jul 2010 10:01:23 +0000 (11:01 +0100)]
[refcnt] Fix embedded image building

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[pcnet32] Fix pcnet32_wio_reset() bug
Andrei Faur [Wed, 7 Jul 2010 12:43:41 +0000 (15:43 +0300)]
[pcnet32] Fix pcnet32_wio_reset() bug

This bug caused .probe to fail because the NIC did not reset properly.

Signed-off-by: Andrei Faur <da3drus@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[romprefix] Do not check for BBS compatibility
Michael Brown [Thu, 24 Jun 2010 18:03:04 +0000 (19:03 +0100)]
[romprefix] Do not check for BBS compatibility

The existence and usage of the BEV entry point is covered by the PnP
spec, not the BBS spec; the BBS spec merely describes a policy for
selecting the boot device order.  gPXE should therefore check only for
a PnP BIOS in order to decide whether or not to hook INT19.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[build] Avoid hard-coding the path to perl
Michael Brown [Thu, 24 Jun 2010 00:23:00 +0000 (01:23 +0100)]
[build] Avoid hard-coding the path to perl

The path "/usr/bin/perl" has been hard-coded since Etherboot 5.1, for
no discernible reason.  Use just "perl" instead to fix the
inconsistency and allow building on systems with Perl installed
outside of /usr/bin.

This commit also includes a later fix that removes a dependency on
"perl" which broke builds from fully clean trees.

Reported-by: Gabor Z. Papp <gzp@papp.hu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[efi] Build gPXE script support into EFI binaries by default
Geoff Lywood [Wed, 16 Jun 2010 21:35:24 +0000 (14:35 -0700)]
[efi] Build gPXE script support into EFI binaries by default

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[refcnt] Add ref_no_free handler
Joshua Oreman [Thu, 26 Nov 2009 01:27:50 +0000 (17:27 -0800)]
[refcnt] Add ref_no_free handler

Since more reference-counted structures than embedded images might
want to mark themselves unfreeable, expose a dummy ref_no_free().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[retry] Use start_timer_fixed() instead of direct timeout manipulation
Michael Brown [Tue, 15 Jun 2010 17:16:02 +0000 (18:16 +0100)]
[retry] Use start_timer_fixed() instead of direct timeout manipulation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[retry] Add timer_init() wrapper function
Michael Brown [Tue, 15 Jun 2010 17:13:36 +0000 (18:13 +0100)]
[retry] Add timer_init() wrapper function

Standardise on using timer_init() to initialise an embedded retry
timer, to match the coding style used by other embedded objects.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[refcnt] Add ref_init() wrapper function
Michael Brown [Tue, 15 Jun 2010 16:33:23 +0000 (17:33 +0100)]
[refcnt] Add ref_init() wrapper function

Standardise on using ref_init() to initialise an embedded reference
count, to match the coding style used by other embedded objects.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[errdb] Add errdb.pl script to build error database
Michael Brown [Mon, 31 May 2010 13:22:24 +0000 (14:22 +0100)]
[errdb] Add errdb.pl script to build error database

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[libc] Enable automated extraction of error usage reports
Michael Brown [Sun, 30 May 2010 14:29:05 +0000 (15:29 +0100)]
[libc] Enable automated extraction of error usage reports

Add preprocessor magic to the error definitions to enable every error
usage to be tracked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[process] Hold reference to process during call to step()
Michael Brown [Fri, 13 Jun 2008 02:39:22 +0000 (03:39 +0100)]
[process] Hold reference to process during call to step()

It is conceivable that the process may terminate during the execution
of step().  If nothing else holds a reference to the containing
object, this would cause the object to be freed prior to returning
from step().

Add a ref_get()/ref_put() around the call to ->step() to prevent this
from happening.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[qib7322] Fix whitespace errors
Michael Brown [Tue, 1 Jun 2010 18:11:38 +0000 (19:11 +0100)]
[qib7322] Fix whitespace errors

Fix up the whitespace errors inadvertently introduced by the
last-minute rename from the internal QLogic codename to "qib7322".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[qib7322] Fix uninitialized variables warning
Shao Miller [Tue, 1 Jun 2010 17:19:33 +0000 (17:19 +0000)]
[qib7322] Fix uninitialized variables warning

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[pxe] Remove obsolete pxe_errortab.c
Michael Brown [Sun, 30 May 2010 22:27:22 +0000 (23:27 +0100)]
[pxe] Remove obsolete pxe_errortab.c

strerror() has not been able to use the PXE-only error table since
commit 9aa61ad ("Add per-file error identifiers") back in 2007.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[efi] Tidy up output of EFI header import script
Michael Brown [Sat, 29 May 2010 22:47:30 +0000 (23:47 +0100)]
[efi] Tidy up output of EFI header import script

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[legal] Add FILE_LICENCE declarations to EFI header files
Michael Brown [Sat, 29 May 2010 22:06:06 +0000 (23:06 +0100)]
[legal] Add FILE_LICENCE declarations to EFI header files

Autodetect the BSD licence statement in EFI header files, and add a
suitable FILE_LICENCE macro to the version imported into the gPXE
tree.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[efi] Synchronise EFI header files
Michael Brown [Sat, 29 May 2010 21:39:22 +0000 (22:39 +0100)]
[efi] Synchronise EFI header files

Now that the PACKED macro conflict is resolved, we can use an
unmodified import of the EFI header files (using
include/gpxe/efi/import.pl).

Synchronised to EDK2 SVN revision 10556.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[build] Remove PACKED macro
Michael Brown [Sat, 29 May 2010 15:51:48 +0000 (16:51 +0100)]
[build] Remove PACKED macro

Most of gPXE uses __attribute__((packed)) anyway, and PACKED conflicts
with an identically-named macro in the upstream EFI header files.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[build] Add rtl8139.rom to the default build target list
Michael Brown [Thu, 27 May 2010 22:20:44 +0000 (23:20 +0100)]
[build] Add rtl8139.rom to the default build target list

rtl8139.rom is the target used in qemu/kvm, which is the default test
platform for iPXE and also commonly used for gPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago[build] Inhibit "skipping incompatible" message from ld
Michael Brown [Thu, 27 May 2010 08:42:53 +0000 (09:42 +0100)]
[build] Inhibit "skipping incompatible" message from ld

On 64-bit systems with both 32-bit and 64-bit libraries installed, ld
tends to generate noisy "skipping incompatible /usr/lib/libxxx.so"
messages when building elf2efi.c.

Fix by passing --no-warn-search-mismatch to ld.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>