summaryrefslogtreecommitdiffstats
path: root/src/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [infiniband] Use generic base16 functions for SRPMichael Brown2010-05-281-9/+7Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Use generic base16 functions for iSCSIMichael Brown2010-05-281-30/+21Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base64] Allow base64_encode() to handle arbitrary dataMichael Brown2010-05-281-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [compiler] Fix 64bit compile time errorsPiotr Jaroszyński2010-05-271-3/+3
| | | | | | | | | | | | Apart from format specifier fixes there are two changes in proper code: - Change type of regs in skge_hw to unsigned long - Cast result of sizeof in myri10ge to uint32_t Both don't change anything for i386 and should be fine on x86_64. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Don't consider invalid offers to be duplicatesJoshua Oreman2010-05-271-3/+3
| | | | | | | | | This fixes a regression in BOOTP support; since BOOTP requests often have the `siaddr' field set to 0.0.0.0, they would be considered duplicates of the first zeroed-out offer slot. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use weak definitions instead of weak declarationsJoshua Oreman2010-05-272-0/+16
| | | | | | | | | | | | | | | This removes the need for inline safety wrappers, marginally reducing the size penalty of weak functions, and works around an apparent binutils bug that causes undefined weak symbols to not actually be NULL when compiling with -fPIE (as EFI builds do). A bug in versions of binutils prior to 2.16 (released in 2005) will cause same-file weak definitions to not work with those toolchains. Update the README to reflect our new dependency on binutils >= 2.16. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Honor PXEBS_SKIP option in discovery controlJoshua Oreman2010-05-271-2/+26
| | | | | | | | | | | | | | | | It is permissible for a DHCP packet containing PXE options to specify only "discovery control", instead of the more typical boot menu + prompt options. This is the strategy used by older versions of dnsmasq; by specifying the discovery control as PXEBS_SKIP, they cause vendor PXE ROMs to ignore boot server discovery and just use the filename and next-server options in the initial (Proxy)DHCP packet. Modify iPXE to accept this behavior, to be more compatible with the Intel firmware. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Tested-by: Kyle Kienapfel <kyle@shadowmage.org> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [wpa] Remove PMKID checkingJoshua Oreman2010-05-271-64/+0Star
| | | | | | | | | | | | PMKID checking is an additional pre-check that helps detect invalid passphrases before going through the full handshaking procedure. It takes up some amount of code size, and is not necessary from a security perspective. It also is implemented improperly by some routers, which was causing iPXE to give spurious authentication errors. Remove it for these reasons. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Update received sequence number before delivering received dataMichael Brown2010-05-221-8/+10
| | | | | | | | | | | | | iPXE 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>
* [lacp] Add simple LACP implementationMichael Brown2010-05-102-0/+270
| | | | | | | | | | Some switch configurations will refuse to enable our port unless we can speak LACP to inform the switch that we are alive. Add a very simple passive LACP implementation that is sufficient to convince at least Linux's bonding driver (when tested using qemu attached to a tap device enslaved to a bond device configured as "mode=802.3ad"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-2050-320/+320
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Record whether or not interrupts are currently enabledMichael Brown2010-03-231-0/+7
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Add netdev_is_open() wrapper functionMichael Brown2010-03-233-10/+10
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [iscsi] Disambiguate some common authentication errorsMichael Brown2010-03-171-14/+27
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [iscsi] Fix interoperability with QNAP TS-639ProDanny Volkind2010-02-221-3/+10
| | | | | Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [http] GET / if URI doesn't contain a pathJoshua Oreman2010-01-271-1/+2
| | | | | | | | | | | Commit 3d9dd93 introduced a regression in HTTP: if a URI without a path is specified (e.g. http://netboot.me), we send the empty string as our GET request. Reintroduce an extra slash when uri->path is NULL, to turn this into the expected GET /. Reported-by: Kyle Kienapfel <doctor.whom@gmail.com> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [dhcp] Keep multiple DHCP offers received, and use them intelligentlyJoshua Oreman2010-01-221-86/+228
| | | | | | | | | | | | | | | | | | | | | | Instead of keeping only the best IP and PXE offers, store all of them, and pick the best to use just before a request is sent. This allows priority differentiation to work even when lower-priority offers provide PXE options, and improves robustness at sites with broken PXE servers intermingled with working ones: when a ProxyDHCP request times out, instead of giving up, we try the next PXE offer we've received. It also allows us to avoid breaking up combined IP+PXE offers, which can be important with some firewall configurations. This behavior matches that of most vendor PXE ROMs. Store a reference to the DHCPOFFER packet in the offer structure, so that when registering settings after a successful ACK we can register the proxy PXE settings we originally received; this removes the need for a nonstandard duplicate REQUEST/ACK to port 67 of proxy servers like dnsmasq that provide PXE options in the OFFER. Total cost: 450 bytes uncompressed. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [ftp] User and password URI support for the FTP protocolgL2n30Y06arv22010-01-211-2/+24
| | | | | | | | | | | | The default user and password are used for anonymous FTP by default. This patch adds support for an explicit user name and password in an FTP URI: imgfetch ftp://user:password@server.com/path/to/file Edited-by: Stefan Hajnoczi <stefanha@gmail.com>. Bugs are my fault. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [uri] Decode/encode URIs when parsing/unparsingJoshua Oreman2010-01-211-19/+12Star
| | | | | | | | | | | | | | | Currently, handling of URI escapes is ad-hoc; escaped strings are stored as-is in the URI structure, and it is up to the individual protocol to unescape as necessary. This is error-prone and expensive in terms of code size. Modify this behavior by unescaping in parse_uri() and escaping in unparse_uri() those fields that typically handle URI escapes (hostname, user, password, path, query, fragment), and allowing unparse_uri() to accept a subset of fields to print so it can be easily used to generate e.g. the escaped HTTP path?query request. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [dhcp] Add generic facility for using cached network settingsJoshua Oreman2010-01-202-1/+97
| | | | | | | | | | | | | | | | | | | | | | When a DHCP session is started (using autoboot or a command-line `dhcp net0'), check whether the new setting use-cached (DHCP option 175.178) is TRUE; if so, skip DHCP and rely on currently registered settings. This lets one combine a static IP with autoboot. Before checking the use-cached setting, call a weak get_cached_dhcpack() hook that can be implemented by particular builds of gPXE supporting some fashion of retrieving a cached DHCPACK packet. If one is available, it is registered as an options source, and then either that packet's option 175.178 or the user's prior manual use-cached setting can allow skipping duplicate DHCP. Using cached packets is not the default because DHCP servers are often configured to give gPXE different options than they give a vendor PXE client; in order to break the infinite loop of PXE chaining, one would need to load a gPXE with an embedded image that does something more than autoboot. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [tftp] Abort requests with error code 0Stefan Hajnoczi2010-01-181-2/+2
| | | | | | | | | There is no defined error code for aborting a request but 0 is commonly used. This patch switches the abort request error code from TFTP_ERR_UNKNOWN_TID (5) to 0. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [tftp] Make TFTP size requests abort transfer with an errorThomas Horsten2010-01-181-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | pxenv_tftp_get_fsize is an API call that PXE clients can call to obtain the size of a remote file. It is implemented by starting a TFTP transfer with pxe_tftp_open, waiting for the response and then stopping the transfer with pxe_tftp_close(). This leaves the session hanging on the TFTP server and it will try to resend the packet repeatedly (verified with tftpd-hpa) until it times out. This patch adds a method "tftpsize" that will abort the transfer after the first packet is received from the server. This will terminate the session on the server and is the same behaviour as Intel's PXE ROM exhibits. Together with a qemu patch to handle the ERROR packet (submitted to qemu's mailing list), this resolves a specific issue where booting pxegrub with qemu's TFTP server would be slow or hang. I've tested this against qemu's tftp server and against my normal boot infrastructure (tftpd-hpa). Booting pxegrub and loading extra files now produces a trace similar to Intel's PXE client and there are no spurious retransmits from tftpd any more. Signed-off-by: Thomas Horsten <thomas@horsten.com> Signed-off-by: Milan Plzik <milan.plzik@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [tftp] Remove unnecessary delay when opening a connectionStefan Hajnoczi2010-01-151-2/+9
| | | | | | | | | | | | | The retry timer is used to retransmit TFTP packets lost on the network, and to start a new connection. There is an unnecessary delay while waiting for name resolution because the timer period is fixed and cannot be shortened when name resolution completes. This patch keeps the timer period at zero while name resolution takes place so that no time is lost once before sending the first packet. Reported-by: Thomas Horsten <thomas@horsten.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [tftp] Allow fetching larger files by wrapping block numberStefan Hajnoczi2010-01-151-3/+6
| | | | | | | | | This patch adds TFTP support for files larger than 65535 blocks by wrapping the 16-bit block number. Reported-by: Mark Johnson <johnson.nh@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [dhcp] Assume PXE options are in DHCPOFFER only if boot menu is includedJoshua Oreman2010-01-151-2/+2
| | | | | | | | | | | | | IBM's Tivoli Provisioning Manager for OS Deployment, when acting as a ProxyDHCP server, sends an initial offer with a vendor class of "PXEClient" and vendor-encapsulated options that have nothing to do with PXE. To differentiate between this case and the case of a ProxyDHCP server that sends all PXE options in its initial offer, modify gPXE to check for the presence of an encapsulated PXE boot menu option (43.9) instead of simply checking for the existence of any encapsulated options at all. This is the same check used by the Intel vendor PXE ROM. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [dhcp] Accept ProxyDHCP replies of type DHCPOFFERJoshua Oreman2010-01-151-1/+1
| | | | | | | | | | The PXE standard provides examples of ProxyDHCP responses being encoded both as type DHCPOFFER and DHCPACK, but currently we only accept DHCPACKs. Since there are PXE servers in existence that respond to ProxyDHCPREQUESTs with DHCPOFFERs, modify gPXE's ProxyDHCP pruning logic to treat both types of responses equally. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [dhcp] Append new DHCP options versus prependShao Miller2010-01-141-4/+15
| | | | | | | | | | | | | Change the behaviour for adding DHCP options into a DHCP packet so that we now append options, rather than insert them in front of whatever options might already be present. Apparently, the DHCP relay logic on a Nortel 470-48T layer 2 switch cares about the order of DHCP options. If we build a DHCP packet pre-populated with some options, their order will now be preserved, except for encapsulated options. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [dhcp] Ensure message type is first DHCP optionShao Miller2010-01-141-0/+1
| | | | | | | | | | | Apparently, the DHCP relay logic on a Nortel 470-48T layer 2 switch cares about the order of DHCP options. Specifically, it requires that the DHCP message type option be the first option present in the DHCP packet. We achieve this by having this option appear first in our dhcp_request_options_data array, which pre-populates DHCP requests. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [802.11] Allow connecting to spectrum managed networksJoshua Oreman2010-01-051-6/+0Star
| | | | | | | | | | | | | | Contrary to the IEEE specification, some access points apparently set the Spectrum Mgmt bit in the capabilities field even when broadcasting on a 2.4GHz band that does not require spectrum management. Allow gPXE to attempt to connect to such networks; if spectrum management is really required, our advertisement of capabilities not including it will result in an association failure. Reported-by: Peter Meyer <residue@xmail.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [wpa] Add CCMP backend (new AES-based cryptosystem)Joshua Oreman2010-01-051-0/+528
| | | | Signed-off-by: Marty Connor <mdc@etherboot.org>
* [wpa] Add TKIP backend (legacy RC4-based cryptosystem)Joshua Oreman2010-01-051-0/+586
| | | | Signed-off-by: Marty Connor <mdc@etherboot.org>
* [wpa] Add pre-shared key frontend (WPA "Personal" with just a passphrase)Joshua Oreman2010-01-051-0/+125
| | | | | Modified-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [wpa] Add general support for WPA-protected 802.11 networksJoshua Oreman2010-01-051-0/+973
| | | | | Modified-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [eapol] Add basic support for 802.1X EAP over LANsJoshua Oreman2010-01-051-0/+85
| | | | | | | | | EAPOL is a container protocol that can wrap either EAP packets or 802.11 EAPOL-Key frames. For cleanliness' sake, add a stub that strips the framing and sends packets off to the appropriate handler if it is compiled in. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [802.11] Add support for WEP-protected networksJoshua Oreman2010-01-051-0/+303
| | | | | | | | WEP is a highly flawed cryptosystem, barely better than no encryption at all, but many people still use it. It does have the advantage of being very simple and small in code size. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [802.11] Add core support for detecting and using encrypted networksJoshua Oreman2010-01-052-59/+751
| | | | Signed-off-by: Marty Connor <mdc@etherboot.org>
* [settings] Add Bus ID settingShao Miller2009-12-142-4/+20
| | | | | | | | Users can find the bus type and PCI IDs for a network interface with: netX/busid Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
* [infiniband] Rename IB_PKEY_NONE to IB_PKEY_DEFAULTMichael Brown2009-11-162-2/+2
| | | | There is no such thing as a non-existent partition.
* [infiniband] Report IB link status as IPoIB netdevice statusMichael Brown2009-11-161-0/+28
|
* [infiniband] Include hostname in node description, if availableMichael Brown2009-11-161-1/+7
|
* [infiniband] Make node description invariant across all portsMichael Brown2009-11-161-4/+5
| | | | | | | IBA section 14.2.5.2 states that "the contents of the NodeDescription attribute are the same for all ports on a node". Satisfy this by using the HCA GUID rather than the port GUID to form the node description string.
* [ipv4] Ignore non-open net devices when performing routingMichael Brown2009-11-161-0/+2
| | | | | | | | | We do not discard routing table entries when closing an interface. It is plausible that multiple interfaces may be on the same physical network; if so, then we may end up in a situation whereby outbound packets attempt to route via a closed interface. Fix by ignoring non-open net devices in ipv4_route().
* [ipv4] Allow calculation of default subnet maskMichael Brown2009-11-161-11/+11
| | | | | | | | | | | | | ipv4.c calculates the default subnet mask before calling fetch_ipv4_setting() to retrieve the configured subnet mask (if any). However, as of commit 612f4e7 "[settings] Avoid returning uninitialised data on error in fetch_xxx_setting()", fetch_ipv4_setting() will zero the IP address if the setting does not exist, rather than leaving it unaltered. Fix by fetching the setting first and calculating the default subnet mask only if necessary.
* [ipv4] Use a zero address to indicate "no gateway", rather than INADDR_NONEMichael Brown2009-11-161-7/+6Star
| | | | | | | | | | | | | | | ipv4.c uses a gateway address of INADDR_NONE to represent "no gateway". It initialises the gateway address to INADDR_NONE before calling fetch_ipv4_setting() to retrieve the configured gateway address (if any). However, as of commit 612f4e7 "[settings] Avoid returning uninitialised data on error in fetch_xxx_setting()", fetch_ipv4_setting() will zero the IP address if the setting does not exist, rather than leaving it unaltered. Fix by using a zero IP address to indicate "no gateway", so that a non-existent gateway address setting will be treated as such.
* [pxebs] Correct endianness of PXE typeJoshua Oreman2009-10-241-2/+2
| | | | | | | | | | The PXE type field is canonically little-endian, but the pxebs command treats it as big-endian in converting the type number passed on the command line to a field value to search against. Fix, to prevent the necessity of incantations like "pxebs net0 1536" to select menu item #6. Signed-off-by: Michael Brown <mcb30@etherboot.org> Modified-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Add the concept of an "Ethernet-compatible" MAC addressMichael Brown2009-10-232-0/+13
| | | | | | | | | | | | | | The iBFT is Ethernet-centric in providing only six bytes for a MAC address. This is most probably an indirect consequence of a similar design flaw in the Windows NDIS stack. (The WinOF IPoIB stack performs all sorts of contortions in order to pretend to the NDIS layer that it is dealing with six-byte MAC addresses.) There is no sensible way in which to extend the iBFT without breaking compatibility with programs that expect to parse it. Add the notion of an "Ethernet-compatible" MAC address to our link layer abstraction, so that link layers can provide their own workarounds for this limitation.
* [infiniband] Send CM requests to target node's GSI rather than SM's GSIMichael Brown2009-10-171-1/+3
|
* [802.11] Support multicast hashingMichael Brown2009-08-122-22/+2Star
| | | | | | | 802.11 multicast hashing is the same as standard Ethernet hashing, so just expose and use eth_mc_hash(). Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
* [802.11] Properly initialize autoassociation processJoshua Oreman2009-08-121-1/+2
| | | | | | | | | | | | | The recent change to process_add() to detect duplicate process additions relies on the fact that all processes will be initialized using process_init_stopped() before being passed to that function. The autoassociation process was not initialized in this fashion, so process_add() erroneously detected it as a duplicate. Fix by using process_init_stopped() to initialize the autoassociation process instead of setting the step member directly. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [dhcp] Fall back to using the hardware address to populate the chaddr fieldMichael Brown2009-08-121-11/+43
| | | | | | | | | | | | | | | | | | | | | | | | For IPoIB, the chaddr field is too small (16 bytes) to contain the 20-byte IPoIB link-layer address. RFC4390 mandates that we should pass an empty chaddr field and rely on the DHCP client identifier instead. This has many problems, not least of which is that a client identifier containing an IPoIB link-layer address is not very useful from the point of view of creating DHCP reservations, since the QPN component is assigned at runtime and may vary between boots. Leave the DHCP client identifier as-is, to avoid breaking existing setups as far as possible, but expose the real hardware address (the port GUID) via the DHCP chaddr field, using the broadcast flag to instruct the DHCP server not to use this chaddr value as a link-layer address. This makes it possible (at least with ISC dhcpd) to create DHCP reservations using host declarations such as: host duckling { fixed-address 10.252.252.99; hardware unknown-32 00:02:c9:02:00:25:a1:b5; }