summaryrefslogtreecommitdiffstats
path: root/src/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [dhcp] Use a random DHCP transaction identifier (xid)Michael Brown2011-09-192-26/+30
| | | | | | | | | iPXE currently uses the last four bytes of the MAC address as the DHCP transaction identifier. Reduce the probability of collisions by generating a random transaction identifier. Originally-implemented-by: Amos Kong <akong@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Allow sufficient headroom for TCP headersMichael Brown2011-09-191-4/+4
| | | | | | | | | | | | | | | TCP currently neglects to allow sufficient space for its own headers when allocating I/O buffers. This problem is masked by the fact that the maximum link-layer header size (802.11) is substantially larger than the common Ethernet link-layer header. Fix by allowing sufficient space for any TCP headers, as well as the network-layer and link-layer headers. Reported-by: Scott K Logan <logans@cottsay.net> Debugged-by: Scott K Logan <logans@cottsay.net> Tested-by: Scott K Logan <logans@cottsay.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Improve debuggingMichael Brown2011-07-161-45/+51
| | | | | | | Use autocolourisation to improve legibility, and move per-packet messages to DBG2(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Fix fragment reassemblyMichael Brown2011-07-161-92/+120
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Fix potential use-after-free in timer_expired()Michael Brown2011-07-161-1/+3
| | | | | | | | | timer->refcnt is allowed to be NULL, in which case the timer's expired() method may end up freeing the timer object. Discovered using valgrind. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Use broadcast link-layer address for all broadcast IPv4 addressesMichael Brown2011-07-151-7/+7
| | | | | | | | When transmitting, use the broadcast link-layer address for any broadcast address (e.g. 192.168.0.255), not just INADDR_BROADCAST (255.255.255.255). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Discard unwanted unicast packetsMichael Brown2011-07-151-10/+50
| | | | | | | | Explicitly discard any unicast packets for addresses that we do not control, to avoid unexpected behaviour when operating in promiscuous mode (which is now the default, thanks to FCoE). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow link layer to report broadcast/multicast packets via pull()Michael Brown2011-07-1512-23/+60
| | | | | | | | Allow the link layer to directly report whether or not a packet is multicast or broadcast at the time of calling pull(), rather than relying on heuristics to determine this at a later stage. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Include port in HTTP Host header as neededMalte Starostik2011-07-151-1/+5
| | | | | | | | | | | According to section 14.23 of RFC2616, an HTTP Host header without port implies the default port is used. Thus, when fetching from anywhere but port 80 for HTTP or 443 for HTTPS, the port ought to be explicitly given in that header. Otherwise, some servers might fail to associate the request with the correct virtual host or generate incorrect self-referencing URLs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Avoid duplicate calls to iscsi_tx_done()Michael Brown2011-06-291-4/+9
| | | | | | | | | | | | The iSCSI TX process can now be woken up by the TCP socket via xfer_window_changed(), so it is no longer valid to assume that iscsi_tx_step() can be called in state ISCSI_TX_IDLE only immediately after completing a transmission. Fix by calling iscsi_tx_done() only upon a transition into state ISCSI_TX_IDLE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Fix size_t format specifiersMichael Brown2011-06-291-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Support read-only HTTP block devicesMichael Brown2011-06-281-59/+308
| | | | | | | | | | Provide support for HTTP range requests, and expose this functionality via the iPXE block device API. This allows SAN booting from a root path such as: sanboot http://boot.ipxe.org/freedos/fdfullcd.iso Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Eliminate polling while TX state machine is idleMichael Brown2011-06-281-13/+67
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Eliminate polling while waiting for window to openMichael Brown2011-06-281-3/+26
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Eliminate polling while waiting for window to openMichael Brown2011-06-281-32/+46
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Use a one-shot process for CMRC shutdownMichael Brown2011-06-281-4/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Use a one-shot process for Fibre Channel name server queriesMichael Brown2011-06-281-4/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Use a one-shot process for Fibre Channel ELS requestsMichael Brown2011-06-281-4/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [process] Pass containing object pointer to process step() methodsMichael Brown2011-06-2811-54/+65
| | | | | | | | | Give the step() method a pointer to the containing object, rather than a pointer to the process. This is consistent with the operation of interface methods, and allows a single function to serve as both an interface method and a process step() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Send xfer_window_changed() when window opensMichael Brown2011-06-281-19/+27
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Send xfer_window_changed() when CMRC connection is establishedMichael Brown2011-06-281-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Send xfer_window_changed() when TLS session is establishedMichael Brown2011-06-281-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Send xfer_window_changed() when FCP link is establishedMichael Brown2011-06-282-13/+56
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Maintain a list of Fibre Channel upper-layer protocol usersMichael Brown2011-06-282-32/+44
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ftp] Remove redundant ftp_data_deliver() methodMichael Brown2011-06-281-25/+4Star
| | | | | | | | ftp_data_deliver() does nothing except pass through the received data to the xfer interface, and so can be eliminated by using a pass-through interface. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Record ARP resolution errorsMichael Brown2011-06-281-0/+2
| | | | | | | | | At the time of attempting ARP resolution, we already know the transmitting network device. We can therefore record ARP errors using netdev_tx_err() so that they show up in the output of "ifstat". Inspired-by: Dominik Russenberger <dominik.russenberger@terreactive.ch> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow non-completion TX errors to be recordedMichael Brown2011-06-281-7/+25
| | | | | | | | Allow TX errors to be recorded against a network device even when the packet didn't make it as far as netdev_tx(). Inspired-by: Dominik Russenberger <dominik.russenberger@terreactive.ch> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Include network device metadata in packet tracesMichael Brown2011-05-051-3/+10
| | | | | | | | | | | | | | | | | (Ab)use the "ident" field in transmitted IPv4 packets to convey metadata about the network device. In particular: bits 0-3 represent the low bits of the "RX" good packet counter bits 4-7 represent the low bits of the "RXE" bad packet counter bits 8-15 represent the transmitted packet sequence number This allows some relevant information about the internal state of the network device to be read out from a packet trace from a non-debug build of iPXE. In particular, it allows a packet trace containing packets transmitted by iPXE to indicate whether or not any packets have been received by iPXE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Support chunked transfer encodingMichael Brown2011-05-051-44/+119
| | | | | | | | Booting from an HTTP SAN will require HTTP range requests, which are defined only in HTTP/1.1 and above. HTTP/1.1 mandates support for "Transfer-Encoding: chunked", so we must support it. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Improve detection of bugs in drivers' TX completion handlingMichael Brown2011-05-031-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Move high-frequency debug messages to DBGLVL_EXTRAMichael Brown2011-05-031-9/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Update ts_recent whenever window is advancedMichael Brown2011-04-031-9/+22
| | | | | | | | | | | | | Commit 3f442d3 ("[tcp] Record ts_recent on first received packet") failed to achieve its stated intention. Fix this (and reduce the code size) by moving the ts_recent update to tcp_rx_seq(). This is the code responsible for advancing the window, called by both tcp_rx_syn() and tcp_rx_data(), and so the window check is now redundant. Reported-by: Frank Weed <zorbustheknight@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tftp] Avoid setting current working URI to "tftp://0.0.0.0/"Michael Brown2011-03-311-5/+9
| | | | | | | Set the current working URI to NULL rather than to "tftp://0.0.0.0/". Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Simplify link-down status messageMichael Brown2011-03-301-3/+9
| | | | | | | | | | | | | | | | | | For devices that start in a link-down state, the user will see a message such as: [Link status: The socket is not connected (http://ipxe.org/38086001)] Waiting for link-up on net0... This is potentially misleading, since it suggests that there is a genuine problem. Add a dedicated error message for "link down", giving instead: [Link status: Down (http://ipxe.org/38086101)] Waiting for link-up on net0... Reported-by: Tal Aloni <tal.aloni.il@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Mark devices as open only if opening succeedsPiotr Jaroszyński2011-03-271-3/+3
| | | | | | | netdev_close() assumes that devices that are open are on the open_list, which wasn't true if device specific opening failed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Record ts_recent on first received packetMichael Brown2011-03-261-5/+8
| | | | | | | | | | | | | | | Commit 6861304 ("[tcp] Handle out-of-order received packets") introduced a regression in which ts_recent would not be updated until the first packet is received in the ESTABLISHED state, i.e. the timestamp from the SYN+ACK packet would be ignored. This causes the connection to be dropped by strictly-conforming TCP peers, such as FreeBSD. Fix by delaying the timestamp window check until after processing the received SYN flag. Reported-by: winders@sonnet.com Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Match terminology in online documentationMichael Brown2011-03-234-9/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Impose a fixed order on settingsMichael Brown2011-03-238-18/+18
| | | | | | | Improve the appearance of the "config" user interface by ensuring that settings appear in some kind of logical order. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Reject attempts to change a network device's bus IDMichael Brown2011-03-231-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Formalise notion of setting applicabilityMichael Brown2011-03-224-0/+62
| | | | | | | | | | | | | | | Expose a function setting_applies() to allow a caller to determine whether or not a particular setting is applicable to a particular settings block. Restrict DHCP-backed settings blocks to accepting only DHCP-based settings. Restrict network device settings blocks to accepting only DHCP-based settings and network device-specific settings such as "mac". Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Add support for sending console output to a syslog serverMichael Brown2011-03-101-0/+206
| | | | | Originally-implemented-by: Anselm Martin Hoffmeister <anselm@hoffmeister.be> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Change default initiator IQNMichael Brown2011-03-031-235/+140Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default initiator IQN is "iqn.2000-09.org.etherboot:UNKNOWN". This is problematic for two reasons: a) the etherboot.org domain (and hence the associated IQN namespace) is not under the control of the iPXE project, and b) some targets (correctly) refuse to allow concurrent connections from different initiators using the same initiator IQN. Solve both problems by changing the default initiator IQN to be iqn.2010-04.org.ipxe:<hostname> if a hostname is set, or iqn.2010-04.org.ipxe:<uuid> if no hostname is set. Explicit initiator IQNs set via DHCP option 203 are not affected by this change. Unfortunately, this change is likely to break some existing configurations, where ACL rules have been put in place referring to the old default initiator IQN. Users may need to update ACLs, or force the use of the old IQN using an iPXE script line such as set initiator-iqn iqn.2000-09.org.etherboot:UNKNOWN or a dhcpd.conf option such as option iscsi-initiator-iqn "iqn.2000-09.org.etherboot:UNKNOWN" Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Fix memory leak in settings applicatorMichael Brown2011-03-031-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Clarify support for NOP-InMichael Brown2011-02-251-24/+9Star
| | | | | | | | | | After a more accurate reading of RFC 3720, it becomes clear how NOPs are supposed to work. The current implementation (which just ignores NOP-Ins) is sufficient to cope with NOP-Ins sent to update CmdSN, but will need to be extended before it can cope with NOP-Ins sent as iSCSI keepalives. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Verify the correct tag in NOP-In PDUsMichael Brown2011-02-251-4/+4
| | | | | | | We should be checking the target transfer tag, rather than the initiator task tag. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Accept NOP-In PDUs sent by the targetMichael Brown2011-02-241-0/+50
| | | | | | | | | | | | Some iSCSI targets (observed with a Synology DS207+ NAS) send unsolicited NOP-Ins to the initiator. RFC 3720 is remarkably unclear and possibly self-contradictory on how NOPs are supposed to work, but it seems as though we can legitimately just ignore any unsolicited NOP-In PDU. Reported-by: Marc Lecuyer <marc@maxiscreen.com> Originally-implemented-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Disambiguate the expected target errors in the login responseMichael Brown2011-02-231-1/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow devices to indicate that interrupts are not supportedMichael Brown2011-01-251-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nvo] Allow resizing of non-volatile stored option blocksMichael Brown2011-01-191-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Allow use of custom reallocation functions for DHCP option blocksMichael Brown2011-01-112-57/+61
| | | | | | | | Allow functions other than realloc() to be used to reallocate DHCP option block data, and specify the reallocation function at the time of calling dhcpopt_init(). Signed-off-by: Michael Brown <mcb30@ipxe.org>