summaryrefslogtreecommitdiffstats
path: root/src/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [dhcp] Rename length fields for DHCP optionsMichael Brown2011-01-102-18/+18
| | | | | | Rename "len" to "used_len" and "max_len" to "alloc_len". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Remove redundant length fields in struct dhcp_packetMichael Brown2011-01-102-12/+2Star
| | | | | | | | The max_len field is never used, and the len field is used only by dhcp_tx(). Remove these two fields, and perform the necessary trivial calculation in dhcp_tx() instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use Ethernet-compatible chaddr, if possibleMichael Brown2010-12-151-21/+27
| | | | | | | | | | | | | | | For IPoIB, we currently use the hardware address (i.e. the eight-byte GUID) as the DHCP chaddr. This works, but some PXE servers (notably Altiris RDP) refuse to respond if the chaddr field is anything other than six bytes in length. We already have the notion of an Ethernet-compatible link-layer address, which is used in the iBFT (the design of which similarly fails to account for non-Ethernet link layers). Use this as the first preferred alternative to the actual link-layer address when constructing the DHCP chaddr field. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Expose vlan_find() to network card driversMichael Brown2010-12-011-2/+1Star
| | | | | | | | | Some network cards automatically strip the VLAN header, providing the VLAN tag via a side channel such as a completion queue entry. These cards need to be able to report receive completions directly against the relevant VLAN device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Use "-" instead of "." as separator in VLAN device namesMichael Brown2010-12-011-1/+1
| | | | | | | | | | | | | | | | | VLAN device names have the form "netX.Y", e.g. "net0.5" for VLAN 5 on net0. This use of "." conflicts with the use of "." as the hierarchical separator in settings block names, with the result that VLAN device settings cannot be accessed by name. It would be trivial to treat the VLAN device settings as being a child of the trunk device settings, but this would cause the VLAN device settings to be applied to the trunk device: for example, setting "net0.5/ip" would then apply the IP address to both net0.5 and net0. Fix by changing the VLAN device name to use "-" instead of ".": the VLAN device "net0.5" is now "net0-5". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Apply settings block name in register_settings()Michael Brown2010-12-014-12/+12
| | | | | | | | Pass the settings block name as a parameter to register_settings(), rather than defining it with settings_init() (and then possibly changing it by directly manipulating settings->name). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Disambiguate the common EINVAL casesMichael Brown2010-12-011-4/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Disambiguate "no nameserver" and "no DNS record" errorsMichael Brown2010-12-011-2/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Use only the first instance of a FIP descriptorMichael Brown2010-11-271-1/+3
| | | | | | | | | | Almost all FIP packets contain at most one instance of each descriptor. A VLAN notification may contain multiple VLAN descriptors. The FCoE specification does not provide any guidance regarding prioritisation of VLANs, so we may choose to arbitrarily choose the first listed VLAN. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Tidy up debug messageMichael Brown2010-11-271-4/+2Star
| | | | | | | | The increase in length in Fibre Channel device names causes the "selected FCF" message to wrap beyond 80 characters. Fix by using abbreviations where possible. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Allow Fibre Channel ports to be explicitly namedMichael Brown2010-11-272-6/+5Star
| | | | | | Use the network interface name as the Fibre Channel port name. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Create Fibre Channel port only when we have selected an FCFMichael Brown2010-11-271-10/+21
| | | | | | | | | Create the Fibre Channel port only when the FCoE port has selected a Fibre Channel Forwarder to use. This avoids the confusion of having an FC port created for the network device on which only VLAN discovery is performed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Add support for FIP VLAN discoveryMichael Brown2010-11-261-3/+149
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Provide vlan_can_be_trunk()Michael Brown2010-11-261-8/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Add non-error debug messagesMichael Brown2010-11-261-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Allow duplicate VLAN creation attemptsMichael Brown2010-11-261-5/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Add support for IEEE 802.1Q VLANsMichael Brown2010-11-202-5/+472
| | | | | Originally-implemented-by: michael-dev@fami-braun.de Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow per-device receive queue processing to be frozenMichael Brown2010-11-201-4/+20
| | | | | | | | | | | | | | Several use cases (e.g. the UNDI API and the EFI SNP API) require access to the raw network device receive queue, and so currently use manual calls to netdev_poll() on a specific network device in order to prevent received packets from being processed by the network stack. As an alternative, provide a flag that allows receive queue processing to be frozen on a per-device basis. When receive queue processing is frozen, packets will be enqueued as normal, but will not be automatically dequeued and passed up the network stack. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Use MAX_LL_NET_HEADER_LEN instead of defining our own MAX_HDR_LENMichael Brown2010-11-191-4/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [udp] Use MAX_LL_NET_HEADER_LEN instead of defining our own UDP_MAX_HLENMichael Brown2010-11-191-3/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lacp] Fix dumping of raw LACP packetsMichael Brown2010-11-181-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Use net device name in debugging messagesMichael Brown2010-11-182-36/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Set PSH flag only on packets containing dataMichael Brown2010-11-111-1/+1
| | | | | Suggested-by: Yelena Kadach <klenusik@hotmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Fix typographical error from previous commitShao Miller2010-11-112-2/+3
| | | | | | | | | | Fix typographical error from commit ea631f6 ("[list] Add list_first_entry()"). The symptom was PXELINUX 3.86 causing a stack overflow under VMware. Tested-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Add support for Fibre Channel name server lookupsMichael Brown2010-11-082-38/+360
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Hold ULP's peer reference while ULP existsMichael Brown2010-11-081-7/+14
| | | | | | | | Allow fc_ulp_decrement() to guarantee to fc_peer_decrement() that the peer reference remains valid for the duration of the call, by ensuring that ulp->peer remains valid while ulp is valid. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Allow peers and ULPs to log out when usage count reaches zeroMichael Brown2010-11-081-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Hold reference to peers and ULPs while calling fc_link_examine()Michael Brown2010-11-081-4/+16
| | | | | | | Allow link examination methods to safely assume that their self-reference remains valid for the duration of the method call. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Log out correct port ID after a successful LOGO requestMichael Brown2010-11-081-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Support Fibre Channel ECHOMichael Brown2010-11-082-81/+222
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcp] Use EINVAL for URI parsing errors and EPROTO for protocol errorsMichael Brown2010-11-081-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Process at most one timer's expiry in each call to retry_step()Michael Brown2010-11-081-3/+9
| | | | | | | | | | | | | | | | | | | | | Calling a timer's expiry method may cause arbitrary consequences, including arbitrary modifications of the list of retry timers. list_for_each_entry_safe() guards against only deletion of the current list entry; it provides no protection against other list modifications. In particular, if a timer's expiry method causes the subsequent timer in the list to be deleted, then the next loop iteration will access a timer that may no longer exist. This is a particularly nasty bug, since absolutely none of the list-manipulation or reference-counting assertion checks will be triggered. (The first assertion failure happens on the next iteration through list_for_each_entry(), showing that the list has become corrupted but providing no clue as to when this happened.) Fix by stopping traversal of the list of retry timers as soon as we hit an expired timer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Add list_first_entry()Michael Brown2010-11-084-23/+24
| | | | | | | | | There are several points in the iPXE codebase where list_for_each_entry() is (ab)used to extract only the first entry from a list. Add a macro list_first_entry() to make this code easier to read. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcp] Avoid quoting exchange ID before exchange is createdMichael Brown2010-11-031-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcp] Fix potential memory leaks on error pathsMichael Brown2010-11-031-0/+2
| | | | | | | | Functions that instantiate objects generally own one reference to the object being created. The error paths must therefore usually call ref_put() to release this reference. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Do not use the command reference number in FCP_CMND IUsMichael Brown2010-10-193-62/+65
| | | | | | | | | | | | | | | The FCP command reference number is intended to be used for controlling precise delivery of FCP commands, rather than being an essentially arbitrary tag field (as with iSCSI and SRP). Use the Fibre Channel local exchange ID as the tag for FCP commands, instead of the FCP command reference. The local exchange ID does not appear within the FCP IU itself, but does appear within the FC frame header; debug traces can therefore still be correlated with packet captures. Reported-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Ensure ISID is consistent within an iSCSI sessionMichael Brown2010-10-181-1/+4
| | | | | | | | | | | | | | | | Commit 5f4ab0d ("[iscsi] Randomise a portion of the ISID to force new session instantiation") introduced a regression by randomising the ISID on each call to iscsi_start_login(), which may be called more than once per connection, rather than on each call to iscsi_open_connection(), which is guaranteed to be called only once per connection. This is incorrect behaviour that causes our connection to be rejected by some iSCSI targets (observed with a COMSTAR target under OpenSolaris). Fix by generating the ISID in iscsi_open_connection(), and storing the randomised ISID as part of the session state. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Randomise a portion of the ISID to force new session instantiationMichael Brown2010-10-161-1/+1
| | | | | | | | | | | | | | | | When a connection to an iSCSI target is broken without gracefully closing the TCP socket, a subsequent connection attempt may fail because the target believes that we are attempting session reinstatement (see RFC3720 section 5.3.1). This has been observed using the Microsoft iSCSI target. Section 9.1.1 of RFC3720 states that initiators should use a stable ISID, however section 5.3.1 shows that the only way to explicitly request that a new session be created is to use a new ISID. Fix by randomising the "qualifier" portion of the ISID. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Use port WWN rather than node WWN as the primary Fibre Channel nameMichael Brown2010-10-152-32/+32
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Request SPMA iff FIP advertisement indicates support for SPMAMichael Brown2010-10-151-5/+18
| | | | | | | | | | | | | | | We currently set both the FP and SP bits in our FIP FLOGI, to allow the FCF the choice of selecting either a fabric-provided or a server- provided MAC address. This complies with the FCoE specification, but has been observed to result in an FLOGI rejection from some FCFs. Fix by recording whether or not the FCF supports SPMA, and requesting only one of FPMA or SPMA in our FIP FLOGI. We choose to prefer SPMA where available, because many iPXE drivers will not be able to receive unicast packets sent to a non-default MAC address. Reported-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Include session state metadata in packet tracesMichael Brown2010-10-091-0/+10
| | | | | | | | | | | | | | | | | (Ab)use the "secs" field in transmitted DHCP packets to convey metadata about the DHCP session state. In particular: bit 0 represents the receipt of a ProxyDHCPOFFER bit 1 represents the receipt of a DHCPOFFER bits 2+ represent the transmitted packet sequence number This allows some relevant information about the internal state of the DHCP session to be read out from a packet trace from a non-debug build of iPXE. It also potentially allows replies to be correlated to their requests (for servers that copy the "secs" field from request to reply). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Omit ProxyDHCPREQUEST if PXE options are present in ProxyDHCPOFFERMichael Brown2010-10-081-37/+67
| | | | | | | | | | | | Some ProxyDHCP implementations seem to violate the PXE specification by expecting the client to retain options from the ProxyDHCPOFFER rather than issuing a separate ProxyDHCPREQUEST. Work around such broken clients by retaining the ProxyDHCPOFFER packet, and proceeding to a ProxyDHCPREQUEST only if the ProxyDHCPOFFER does not already contain PXE options. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Ignore DHCPACKs containing incorrect IP addressesMichael Brown2010-10-081-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Revert various patchesMichael Brown2010-10-081-254/+88Star
| | | | | | | | | | | | | | | | A recent patch series breaks compatibility with various common DHCP implementations. Revert "[dhcp] Don't consider invalid offers to be duplicates" This reverts commit 905ea567534bbb67b83b2be41bfcd42209681e6a. Revert "[dhcp] Honor PXEBS_SKIP option in discovery control" This reverts commit 620b98ee4b9d8fa87c56bfa72b4391c1eed9dce6. Revert "[dhcp] Keep multiple DHCP offers received, and use them intelligently" This reverts commit 5efc2fcb602864e82de2cd7414e3828f589034e5. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Add support for the FCoE Initialization Protocol (FIP)Michael Brown2010-10-071-44/+676
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Update ELS port IDs when receiving an ELS frameMichael Brown2010-10-071-3/+22
| | | | | | | | The port ID assigned by the FLOGI response is implicit in the destination ID used for the response (which will differ from the source ID used for the corresponding request). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Include port IDs in metadata for received Fibre Channel framesMichael Brown2010-10-072-9/+26
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Pass both link-layer addresses in net_tx() and net_rx()Michael Brown2010-10-0710-24/+47
| | | | | | | | | FCoE requires the use of fabric-provided MAC addresses, which breaks the assumption that the net device's MAC address is implicitly the source address for net_tx() and the (unicast) destination address for net_rx(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcp] Add support for describing an FCP device using EDDMichael Brown2010-09-221-4/+68
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Add support for identifying the underlying hardware deviceMichael Brown2010-09-221-0/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>