summaryrefslogtreecommitdiffstats
path: root/src/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [dhcp] Allow for missing server ID in ProxyDHCPACKMichael Brown2009-01-211-9/+13
| | | | | | | | | | | | The Linux PXE server (http://www.kano.org.uk/projects/pxe) does not set the server identifier in its ProxyDHCP responses. If the server ID is missing, do not treat this as an error. This resolves the "vague and unsettling memory" mentioned in commit fdb8481d ("[dhcp] Verify server identifier on ProxyDHCPACKs"). Note that we already accept ProxyDHCPOFFERs without a server identifier; they get treated as potential BOOTP packets.
* [dhcp] Include gPXE version number within DHCP requestMichael Brown2009-01-081-0/+4
|
* [infiniband] Call ib_open() only when opening the IPoIB net deviceMichael Brown2009-01-021-7/+36
| | | | | Defer the call to ib_open() until we want to actually open the device, rather than when the device is registered.
* [netdevice] Provide function to retrieve the most recently opened net deviceMichael Brown2008-11-211-0/+26
| | | | | | | | | | There are currently four places within the codebase that use a heuristic to guess the "boot network device", with varying degrees of success. Add a feature to the net device core to maintain a list of open network devices, in order of opening, and provide a function last_opened_netdev() to retrieve the most recently opened net device. This should do a better job than the current assortment of guess_boot_netdev() functions.
* [aoe] Use an AoE config query to identify the target MAC addressMichael Brown2008-11-191-51/+145
| | | | | | | | | | | | | | | | The AoE spec does not specify that the source MAC address of a received packet actually matches the MAC address of the AoE target. In principle an AoE server can respond to an AoE request on any interface available to it, which may not be an address configured to accept AoE requests. This issue is resolved by implementing AoE device discovery. The purpose of AoE discovery is to find out which addresses an AoE target can use for requests. An AoE configuration command is sent when the AoE attach is attempted. The AoE target must respond to that configuration query from an interface that can accept requests. Based on a patch from Ryan Thomas <ryan@coraid.com>
* [x86_64] Fix assorted 64-bit compilation errors and warningsMichael Brown2008-11-193-9/+11
| | | | | | Remove various 32-bit assumptions scattered throughout the codebase. The code is still not necessarily 64-bit clean, but will at least compile.
* [i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] longMichael Brown2008-11-192-6/+6
| | | | | | This brings us in to line with Linux definitions, and also simplifies adding x86_64 support since both platforms have 2-byte shorts, 4-byte ints and 8-byte long longs.
* [build] Keep gcc 4.4 happyMichael Brown2008-11-182-20/+19Star
| | | | | gcc 4.4 adds another few warnings, and also seems to complain if we place %ebp in the clobber list for any inline asm.
* [infiniband] Add raw packet parser and constructorMichael Brown2008-11-111-8/+127
| | | | | | | This can be used with cards that require the driver to construct and parse packet headers manually. Headers are optionally handled out-of-line from the packet payload, since some such cards will split received headers into a separate ring buffer.
* [infiniband] Split subnet management agent client out into ib_smc.cMichael Brown2008-11-111-149/+2Star
| | | | | | | | Not all Infiniband cards have embedded subnet management agents. Split out the code that communicates with such an embedded SMA into a separate ib_smc.c file, and have drivers call ib_smc_update() explicitly when they suspect that the answers given by the embedded SMA may have changed.
* [infiniband] Pass address vector in receive completionsMichael Brown2008-11-111-20/+18Star
| | | | | | | | | | | | | | | | | Receive completion handlers now get passed an address vector containing the information extracted from the packet headers (including the GRH, if present), and only the payload remains in the I/O buffer. This breaks the symmetry between transmit and receive completions, so remove the ib_completer_t type and use an ib_completion_queue_operations structure instead. Rename the "destination QPN" and "destination LID" fields in struct ib_address_vector to reflect its new dual usage. Since the ib_completion structure now contains only an IB status code, ("syndrome") replace it with a generic gPXE integer status code.
* [infiniband] Maintain queue fill level as a property of a work queueMichael Brown2008-11-111-0/+91
| | | | | Both queue owners and drivers often need to keep track of the fill level, so let's make it a generic property.
* [infiniband] Flush uncompleted work queue entries at QP teardownMichael Brown2008-11-111-2/+29
| | | | | | | | | | | | | | Avoid leaking I/O buffers in ib_destroy_qp() by completing any outstanding work queue entries with a generic error code. This requires the completion handlers to be available to ib_destroy_qp(), which is done by making them static configuration parameters of the CQ (set by ib_create_cq()) rather than being provided on each call to ib_poll_cq(). This mimics the functionality of netdev_{tx,rx}_flush(). The netdev flush functions would previously have been catching any I/O buffers leaked by the IPoIB data queue (though not by the IPoIB metadata queue).
* [netdevice] Retain and report detailed error breakdownsMichael Brown2008-11-081-4/+42
| | | | | | | | | | netdev_rx_err() and netdev_tx_complete_err() get passed the error code, but currently use it only in debug messages. Retain error numbers and frequencey counts for up to NETDEV_MAX_UNIQUE_ERRORS (4) different errors for each of TX and RX. This allows the "ifstat" command to report the reasons for TX/RX errors in most cases, even in non-debug builds.
* [aoe] Start retry timer before potential temporary transmission failureMichael Brown2008-11-081-4/+11
| | | | | | | The retry timer needs to be running as soon as we know that we are trying to transmit a command. If transmission fails because of a temporary error condition, then the timer will allow us to retry the transmission later.
* [settings] Add the notion of a "tag magic" to numbered settingsMichael Brown2008-10-302-2/+2
| | | | | | | | | | | | | | | | | | | Settings can be constructed using a dotted-decimal notation, to allow for access to unnamed settings. The default interpretation is as a DHCP option number (with encapsulated options represented as "<encapsulating option>.<encapsulated option>". In several contexts (e.g. SMBIOS, Phantom CLP), it is useful to interpret the dotted-decimal notation as referring to non-DHCP options. In this case, it becomes necessary for these contexts to ignore standard DHCP options, otherwise we end up trying to, for example, retrieve the boot filename from SMBIOS. Allow settings blocks to specify a "tag magic". When dotted-decimal notation is used to construct a setting, the tag magic value of the originating settings block will be ORed in to the tag number. Store/fetch methods can then check for the magic number before interpreting arbitrarily-numbered settings.
* [tftp] Add EUNIQ_xx values to differentiate the many EINVAL errorsMichael Brown2008-10-221-7/+16
|
* [netdevice] Change link-layer push() and pull() methods to take raw typesMichael Brown2008-10-162-20/+22
| | | | | | | | | | EFI requires us to be able to specify the source address for individual transmitted packets, and to be able to extract the destination address on received packets. Take advantage of this to rationalise the push() and pull() methods so that push() takes a (dest,source,proto) tuple and pull() returns a (dest,source,proto) tuple.
* [netdevice] Split multicast hashing out into an mc_hash methodMichael Brown2008-10-162-14/+31
| | | | | | Multicast hashing is an ugly overlap between network and link layers. EFI requires us to provide access to this functionality, so move it out of ipv4.c and expose it as a method of the link layer.
* [retry] Use a separate flag to indicate that a retry timer is runningMichael Brown2008-10-121-4/+8
| | | | | Using start==0 to indicate a stopped timer is dangerous, because 0 is a valid value for the current tick counter.
* [makefile] Add -Wformat-nonliteral as an extra warning categoryMichael Brown2008-10-101-20/+41
| | | | | | | | | | | -Wformat-nonliteral is not enabled by -Wall and needs to be explicitly specified. Modified the few files that use nonliteral format strings to work with this new setting in place. Inspired by a patch from Carl Karsten <carl@personnelware.com> and an identical patch from Rorschach <r0rschach@lavabit.com>.
* [iscsi] Fix LUN parsing in the iSCSI root-pathMichael Brown2008-09-281-11/+14
|
* [dhcp] Accept BOOTP as well as DHCPMichael Brown2008-09-251-7/+9
|
* [iscsi] Change default initiator name prefix to "iqn.2000-01.org.etherboot:"Michael Brown2008-09-191-1/+1
| | | | | | | | | | | | The domain etherboot.org was actually registered on 2000-01-09, not 2000-09-01. (To put it another way, it was registered on 1/9/2000 (US date format) rather than 1/9/2000 (sensible date format); this may illuminate the cause of the error.) "iqn.2000-09.org.etherboot:" is still valid as per RFC3720, but may be surprising to users, so change it to something less unexpected. Thanks to the anonymous contributor for pointing this one out.
* [undi] Fill in ProtType correctly in PXENV_UNDI_ISRMichael Brown2008-08-202-21/+47
| | | | | | | | | Determine the network-layer packet type and fill it in for UNDI clients. This is required by some NBPs such as emBoot's winBoot/i. This change requires refactoring the link-layer portions of the gPXE netdevice API, so that it becomes possible to strip the link-layer header without passing the packet up the network stack.
* [dhcp] Do not restrict minimum retry time for ProxyDHCPREQUESTMichael Brown2008-08-131-0/+1
| | | | | | | | | | | The ProxyDHCPREQUEST is a unicast packet, so the first request will almost always be lost due to not having the IP address in the ARP cache. If the minimum retry time is set to one second (as per commit ff2b6a5), then ProxyDHCP will time out and give up before managing to successfully transmit a request. The DHCP timers need to be reworked anyway, so this mild hack is acceptable for now.
* [retry] Added configurable timeouts to retry timerAndrew Schran2008-08-122-13/+17
| | | | | | | | New min_timeout and max_timeout fields in struct retry_timer allow users of this timer to set their own desired minimum and maximum timeouts, without being constrained to a single global minimum and maximum. Users of the timer can still elect to use the default global values by leaving the min_timeout and max_timeout fields as 0.
* [iSCSI] Add support for mutual CHAPMichael Brown2008-08-111-45/+266
| | | | Allow initiator to verify target authentication using CHAP.
* [pxe] If no ProxyDHCPACK exists, use DHCPACK for the fake ProxyDHCPACK packetMichael Brown2008-08-021-5/+3Star
| | | | | | | | | | | | | WinPE seems to have a bug that causes it to always use the TFTP server IP address and filename from the ProxyDHCPACK packet, even if the ProxyDHCPACK packet doesn't exist. This causes it to end up attempting to fetch a file such as tftp://0.0.0.0/bootmgr.exe If we don't have a ProxyDHCPACK to use, we pretend that it was a copy of the DHCPACK packet. This works around the problem, and hopefully won't surprise any NBPs.
* [dhcp] Work around a bug in Altiris RDPMichael Brown2008-08-011-2/+2
| | | | | | | Altiris erroneously cares about the ordering of DHCP options, and will get confused if we don't construct them in the order it expects. This is observed (so far) only when attempting to deploy 64-bit Win2k3.
* [ftp] Terminate processing after receiving an errorSergey Vlasov2008-07-301-0/+1
| | | | | | | | | When an error reply (not 1xx, 2xx or 3xx) was received, ftp_reply() invoked ftp_done() to close connections, but did not return, and the rest of code in this function could try to send commands to the closed control connection. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
* [ftp] Cope with RETR completion prior to all data receivedMichael Brown2008-07-301-15/+33
| | | | | | | | | | | | Based on a patch contributed by Sergey Vlasov <vsu@altlinux.ru> : In my testing with "qemu -net user" the 226 response to RETR was often received earlier than final packets of the data connection; this caused the received file to become truncated without any error indication. Fix this by adding an intermediate state FTP_TRANSFER between FTP_RETR and FTP_QUIT, so that the transfer is considered to be complete only when both the end of data connection is encountered and the final reply to the RETR command is received.
* [udp] Avoid reusing auto-allocated ports after connection close.Michael Brown2008-07-101-2/+3
| | | | | This duplicates a fix made to tcp.c in commit d5735c631cf26d8e1bcf7b5e635623b52d6b48aa.
* [dhcp] Verify DHCP server source portMichael Brown2008-07-101-16/+45
| | | | | | Verifying server ID and DHCP transaction ID is insufficient to differentiate between DHCPACK and ProxyDHCPACK when the DHCP server and Proxy DHCP server are the same machine.
* [dhcp] Allow DHCP non-option settings to be clearedMichael Brown2008-07-081-0/+3
| | | | | | dhcppkt_store() is supposed to clear the setting if passed NULL for the setting data. In the case of fixed-location fields (e.g. client IP address), this requires setting the content of the field to all-zeros.
* [tftp] Strip the initial '/' to keep Windows TFTP servers happy.Michael Brown2008-07-031-6/+19
|
* [dhcp] Verify server identifier on ProxyDHCPACKsMichael Brown2008-07-011-7/+25
| | | | | | | | | | Perform the same test for a matching DHCP_SERVER_IDENTIFIER on ProxyDHCPACKs as we do for DHCPACKs. Otherwise, a retransmitted DHCPACK can end up being treated as the ProxyDHCPACK. I have a vague and unsettling memory that this test was deliberately omitted, but I can't remember why, and can't find anything in the VC logs.
* [slam] Add support for SLAM window lengths of greater than one packetMichael Brown2008-06-111-11/+30
| | | | | | | | | | | Add the definition of SLAM_MAX_BLOCKS_PER_NACK, which is roughly equivalent to a TCP window size; it represents the maximum number of packets that will be requested in a single NACK. Note that, to keep the code size down, we still limit ourselves to requesting only a single range per NACK; if the missing-block list is discontiguous then we may request fewer than SLAM_MAX_BLOCKS_PER_NACK blocks.
* [slam] Implement SLAM flow controlMichael Brown2008-06-111-107/+85Star
| | | | | | | | | | | | | | | | On any fast network, or with any driver that may drop packets (e.g. Infiniband, which has very small RX rings), the traditional usage of the SLAM protocol will result in enormous numbers of packet drops and a consequent large number of retransmissions. By adapting the client behaviour, we can force the server to act more like a multicast TFTP server, with flow control provided by a single master client. This behaviour should interoperate with any traditional SLAM client (e.g. Etherboot 5.4) on the network. The SLAM protocol isn't actually documented anywhere, so it's hard to define either behaviour as compliant or otherwise.
* [retry] Add start_timer_fixed()Michael Brown2008-06-111-5/+4Star
| | | | Allow for timers to be started with fixed timeouts.
* [dhcp] Do not transition to DHCPREQUEST without a valid DHCPOFFERMichael Brown2008-06-111-1/+1
| | | | | | A missing test for dhcp->dhcpoffer in dhcp_timer_expired() was causing the client to transition to DHCPREQUEST after timing out on waiting for ProxyDHCP even if no DHCPOFFERs had been received.
* [slam] Request all remaining blocks if we run out of space for the blocklistMichael Brown2008-06-101-22/+41
| | | | | | | | In a SLAM NACK packet, if we run out of space to represent the missing-block list, then indicate all remaining blocks as missing. This avoids the need to wait for the one-second timeout before receiving the blocks that otherwise wouldn't have been requested due to running out of space.
* [slam] Speed up NACK transmission by restricting the block-list lengthMichael Brown2008-06-101-20/+62
| | | | | | | | | | Shorter NACK packets take less time to construct and spew out less debug output, and there's a limit to how useful it is to send a complete missing-block list anyway; if the loss rate is high then we're going to have to retransmit an updated missing-block list anyway. Also add pretty debugging output to show the list of requested blocks.
* [slam] Fix multicast address parsingMichael Brown2008-06-101-8/+11
| | | | | slam_parse_multicast_address() was failing to strip the initial "/" from the URI path.
* [slam] Add Scalable Local Area Multicast (SLAM) protocol supportMichael Brown2008-06-101-0/+749
| | | | | Tested against the mini-slamd server located in contrib/mini-slamd with a single client, on a lossy network.
* [udp] Verify local socket address (if specified) for UDP socketsMichael Brown2008-06-101-22/+29
| | | | | | UDP sockets can be used for multicast, at which point it becomes plausible that we could receive packets that aren't destined for us but that still match on a port number.
* [DHCP] Add "dhcp-server" setting to help end-user diagnosticsMichael Brown2008-06-051-0/+8
|
* [TCP] Avoid shrinking TCP windowMichael Brown2008-06-051-17/+50
| | | | | | | | | | | | | | | Maintain state for the advertised window length, and only ever increase it (instead of calculating it afresh on each transmit). This avoids triggering "treason uncloaked" messages on Linux peers. Respond to zero-length TCP keepalives (i.e. empty data packets transmitted outside the window). Even if the peer wouldn't otherwise expect an ACK (because its packet consumed no sequence space), force an ACK if it was outside the window. We don't yet generate TCP keepalives. It could be done, but it's unclear what benefit this would have. (Linux, for example, doesn't start sending keepalives until the connection has been idle for two hours.)
* [iSCSI] Produce meaningful errors on login failureMichael Brown2008-06-041-3/+34
| | | | | | | | Return the most appropriate of EACCES, EPERM, ENODEV, ENOTSUP, EIO or EINVAL depending on the exact error returned by the target, rather than just always returning EPERM. Also, ensure that error strings exist for these errors.
* [IPv4] Fix multicast address checkingMichael Brown2008-05-191-1/+1
| | | | | | | | | | | From: Viswanath Krishnamurthy <viswa.krish@gmail.com> The current ipv4 incorrectly checks the IP address for multicast address. This causes valid IPv4 unicast address to be trated as multicast address For e.g if the PXE/tftp server IP address is 192.168.4.XXX where XXX is 224 or greater, it gets treated as multicast address and a ethernet multicast address is sent out on the wire causing timeouts