summaryrefslogtreecommitdiffstats
path: root/src/net
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [iSCSI] Offer CHAP authentication only if we have a username and passwordMichael Brown2008-04-241-4/+5
| | | | | | | | | | | | | | | | Some EMC targets will fail if we advertise that we can authenticate with CHAP, but the target is configured to allow unauthenticated access to that target. We advertise AuthMethod=CHAP,None; the target should (I think) select AuthMethod=None for unprotected targets. IETD does this, but an EMC Celerra NS83 doesn't. Fix by offering only AuthMethod=None if the user hasn't supplied a username and password; this means that we won't be offering CHAP authentication unless the user is expecting to use it (in which case the target is presumably configured appropriately). Many thanks to Alessandro Iurlano <alessandro.iurlano@gmail.com> for reporting and helping to diagnose this problem.
* [Infiniband] Move event-queue process from driver to Infiniband coreMichael Brown2008-04-211-27/+62
|
* [Infiniband] Add preliminary multiple port support for Hermon cardsMichael Brown2008-04-181-41/+52
| | | | | | | | | | | | Infiniband devices no longer block waiting for link-up in register_ibdev(). Hermon driver needs to create an event queue and poll for link-up events. Infiniband core needs to reread MAD parameters when link state changes. IPoIB needs to cope with Infiniband link parameters being only partially available at probe and open time.
* [http] gPXE is a HTTP/1.0 client, not a HTTP/1.1 clientH. Peter Anvin2008-03-311-1/+1
| | | | | | | | | | | | | | | gPXE is not compliant with the HTTP/1.1 specification (RFC 2616), since it lacks support for "Transfer-Encoding: chunked". gPXE is, however, compliant with the HTTP/1.0 specification (RFC 1945), which does not require "Transfer-Encoding: chunked" to be supported. The only HTTP/1.1 feature that gPXE uses is the "Host:" header, but servers universally accept that one from HTTP/1.0 clients as an optional extension (it is obligatory for HTTP/1.1). gPXE does not, for example, appear to support connection caching. Advertising as a HTTP/1.0 client will typically make the server close the connection immediately upon sending the last data, which is actually beneficial if we aren't going to keep the connection alive anyway.
* [Settings] Expose SMBIOS via settings APIMichael Brown2008-03-281-2/+3
| | | | In particular, expose the system UUID as a setting ("smbios/uuid").
* [DHCP] Add support for ProxyDHCP requestsMichael Brown2008-03-272-348/+550
| | | | | | | | | | | | | | | | The PXE spec is (as usual) unclear on precisely when ProxyDHCPREQUESTs should be issued. We adapt the following, slightly paranoid approach: If an offer contains an IP address, then it is a normal DHCPOFFER. If an offer contains an option #60 "PXEClient", then it is a ProxyDHCPOFFER. Note that the same packet can be both a normal DHCPOFFER and a ProxyDHCPOFFER. After receiving the normal DHCPACK, if we have received a ProxyDHCPOFFER, we unicast a ProxyDHCPREQUEST back to the ProxyDHCP server on port 4011. If we time out waiting for a ProxyDHCPACK, we treat this as a non-fatal error.
* [DHCP] Treat empty fields in DHCP packets as non-existent.Michael Brown2008-03-271-10/+48
| | | | | This avoids confusing other code by insisting that we have e.g. a filename consisting of 128 zero bytes.
* [DHCP] Save precious packet-aligned memory by copying DHCP responsesMichael Brown2008-03-261-33/+16Star
| | | | | Copy DHCP responses to a standard malloc()ed buffer, rather than retaining the I/O buffer that they arrived in.
* [Settings] Remove assumption that all settings have DHCP tag valuesMichael Brown2008-03-259-297/+503
| | | | | | | | | | | | Allow for settings to be described by something other than a DHCP option tag if desirable. Currently used only for the MAC address setting. Separate out fake DHCP packet creation code from dhcp.c to fakedhcp.c. Remove notion of settings from dhcppkt.c. Rationalise dhcp.c to use settings API only for final registration of the DHCP options, rather than using {store,fetch}_setting throughout.
* [DHCP] Fix DHCP state confusion.Michael Brown2008-03-251-2/+5
| | | | | DHCP code was using an incorrect check for whether to construct a DHCPDISCOVER or DHCPREQUEST packet.
* [Settings] copy_settings() should not fail if some settings are missing!Michael Brown2008-03-241-18/+54
|
* [IPv4] Use default netmasks when no subnet mask is specified.Michael Brown2008-03-231-7/+20
|
* [DHCP] Fix up fake-packet creation as used by PXENV_GET_CACHED_INFOMichael Brown2008-03-231-37/+107
| | | | | | | | | | | Add dedicated functions create_dhcpdiscover(), create_dhcpack() and create_proxydhcpack() for use by external code such as the PXE preboot code. Register ProxyDHCP options under the global scope "proxydhcp". Unregister previously-acquired DHCP and ProxyDHCP settings when DHCP succeeds.
* [DHCP] FIXME: quick temporary settings fix, needs update for new APIMarty Connor2008-03-221-0/+4
|
* [Settings] Implement simple_settings backed with extensible DHCP optionsMichael Brown2008-03-221-4/+4
|
* [Settings] DHCP is now working using the new settings API.Michael Brown2008-03-213-10/+23
|
* [Settings] Migrate DHCP and NVO code to the new settings API (untested)Michael Brown2008-03-213-685/+599Star
|
* [DHCP] Kill off some no-longer-used DHCP functionsMichael Brown2008-03-211-118/+0Star
|
* [Settings] Use a settings applicator to set the default TFTP URI.Michael Brown2008-03-212-35/+43
|
* [Settings] Use a settings applicator to configure IPv4 routes.Michael Brown2008-03-213-78/+40Star
|
* [Settings] Introduce settings applicators.Michael Brown2008-03-213-98/+102
| | | | | | | Convert DHCP option applicators in dns.c and iscsi.c to settings applicators. Kill off DHCP option applicators.
* [Settings] Add per-netdevice settings blockMichael Brown2008-03-202-0/+109
| | | | | | | | | Add a configuration settings block for each net device. This will provide the parent scope for settings applicable only to that network device (e.g. non-volatile options stored on the NIC, options obtained via DHCP, etc.). Expose the MAC address as a setting.