summaryrefslogtreecommitdiffstats
path: root/src/net/udp
Commit message (Collapse)AuthorAgeFilesLines
...
* [settings] Move user-class setting from dhcp.c to settings.cMichael Brown2013-11-141-8/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Add DHCP network device configuratorMichael Brown2013-11-051-0/+6
| | | | | | | Provide an interface to DHCP via the generic network device configurator mechanism. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Always retrieve cached DHCPACK and apply to relevant network deviceMichael Brown2013-10-251-26/+1Star
| | | | | | | | | | | | When chainloading, always retrieve the cached DHCPACK packet from the underlying PXE stack, and apply it as the original contents of the "net<X>.dhcp" settings block. This allows cached DHCP settings to be used for any chainloaded iPXE binary (not just undionly.kkpxe). This change eliminates the undocumented "use-cached" setting. Issuing the "dhcp" command will now always result in a fresh DHCP request. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix uses of literal 0 as a NULL pointerMichael Brown2013-04-281-1/+1
| | | | | | Detected using sparse. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uuid] Abstract UUID mangling code out to a separate uuid_mangle() functionMichael Brown2013-03-201-3/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use PXE byte ordering for UUID in DHCP option 97Michael Brown2013-03-201-1/+8
| | | | | | | | The PXE spec does not specify a byte ordering for UUIDs, but RFC4578 suggests that it follows the EFI spec, in which the first three fields are little-endian. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tftp] Allow TFTP block size to be controlled via the PXE TFTP APIMichael Brown2013-03-061-20/+8Star
| | | | | | | | | | | | | | The PXE TFTP API allows the caller to request a particular TFTP block size. Since mid-2008, iPXE has appended a "?blksize=xxx" parameter to the TFTP URI constructed internally; nothing has ever parsed this parameter. Nobody seems to have cared that this parameter has been ignored for almost five years. Fix by using xfer_window(), which provides a fairly natural way to convey the block size information from the PXE TFTP API to the TFTP protocol layer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [src] Fix spelling in comments, debug messages and local variable namesStefan Weil2013-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes in comments and debug messages: existance -> existence unecessary -> unnecessary occured -> occurred decriptor -> descriptor neccessary -> necessary addres, adress -> address initilize -> initialize sucessfully -> successfully paramter -> parameter acess -> access upto -> up to likelyhood ->likelihood thru -> through substracting -> subtracting lenght -> length isnt -> isn't interupt -> interrupt publically -> publicly (this one was not wrong, but unusual) recieve -> receive accessable -> accessible seperately -> separately pacet -> packet controled -> controlled dectect -> detect indicies -> indices extremly -> extremely boundry -> boundary usefull -> useful unuseable -> unusable auxilliary -> auxiliary embeded -> embedded enviroment -> environment sturcture -> structure complier -> compiler constructes -> constructs supress -> suppress intruduced -> introduced compatability -> compatibility verfication -> verification ths -> the reponse -> response Fixes in local variable names: retreive -> retrieve Most of these fixes were made using codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Include version number within only a single object fileMichael Brown2012-11-021-3/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Expose Ethernet-compatible eIPoIB link-layer addresses and headersMichael Brown2012-08-311-2/+10
| | | | | | | | | | | | | Almost all clients of the raw-packet interfaces (UNDI and SNP) can handle only Ethernet link layers. Expose an Ethernet-compatible link layer to local clients, while remaining compatible with IPoIB on the wire. This requires manipulation of ARP (but not DHCP) packets within the IPoIB driver. This is ugly, but it's the only viable way to allow IPoIB devices to be driven via the raw-packet interfaces. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-205-5/+10
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Include hostname within syslog messages where possibleMichael Brown2012-06-201-4/+52
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Move "domain" setting from dns.c to settings.cMichael Brown2012-06-201-8/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Request broadcast responses when we already have an IPv4 addressMichael Brown2012-06-201-0/+7
| | | | | | | | | | | | | | | | | FCoE requires the use of multiple local unicast link-layer addresses. To avoid the complexity of managing multiple addresses, iPXE operates in promiscuous mode. As a consequence, any unicast packets with non-matching IPv4 addresses are rejected at the IPv4 layer (rather than at the link layer). This can cause problems when issuing a second DHCP request: if the address chosen by the DHCP server does not match the existing address, then the DHCP response will itself be rejected. Fix by requesting a broadcast response from the DHCP server if the network interface already has any IPv4 addresses. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tftp] Allow builds without TFTP supportMichael Brown2012-04-171-8/+0Star
| | | | | | | Allow TFTP to be configured out by moving the next-server setting definition (which is used by autoboot.c) from tftp.c to settings.c. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Pass internal syslog() priority through to syslog consoleMichael Brown2012-03-261-2/+21
| | | | | | | Use a private ANSI escape sequence to convey the priority of an internal syslog() message through to the syslog server. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Do not share ANSI escape context between lineconsole usersMichael Brown2012-03-261-0/+8
| | | | | | | | An ANSI escape sequence context cannot be shared between multiple users. Make the ANSI escape sequence context part of the line console definition and provide individual contexts for each user. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Exclude text-based UI output from logfile-based consolesMichael Brown2012-03-261-1/+1
| | | | | | | | The output from text-based user interfaces such as the "config" command is not generally meaningful for logfile-based consoles such as syslog and vmconsole. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Allow usage to be defined independently for each consoleMichael Brown2012-03-261-0/+8
| | | | | | | | | | | | | | | | | | | | | Add the concept of a "console usage", such as "standard output" or "debug messages". Allow usages to be associated with each console independently. For example, to send debugging output via the serial port, while preventing it from appearing on the local console: #define CONSOLE_SERIAL CONSOLE_USAGE_ALL #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG ) If no usages are explicitly specified, then a default set of usages will be applied. For example: #define CONSOLE_SERIAL will have the same affect as #define CONSOLE_SERIAL CONSOLE_USAGE_ALL Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Separate out generic line-based console functionalityMichael Brown2012-02-291-36/+8Star
| | | | | | | Abstract out the generic line-handling portions of the syslog putchar() routine, to allow use by other console types. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Disable console when no syslog server is definedMichael Brown2012-02-291-7/+5Star
| | | | | | | | Explicitly disable the syslog console when no syslog server is defined, rather than (ab)using the socket family address as an equivalent console-enabled flag. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Allow trailing dots in DNS namesMichael Brown2012-01-111-9/+15
| | | | | Reported-by: Christian Hesse <list@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Add PXE-mandated DHCP options [128,135] to parameter request listMichael Brown2011-12-061-0/+1
| | | | | | | | The PXE specification requires us to request DHCP options 128 to 135 inclusive, although these have no defined purpose. Suggested-by: Ralf Buettner <rab@bootix.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use a random DHCP transaction identifier (xid)Michael Brown2011-09-191-23/+24
| | | | | | | | | 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>
* [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>
* [settings] Match terminology in online documentationMichael Brown2011-03-232-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Impose a fixed order on settingsMichael Brown2011-03-234-7/+7
| | | | | | | 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>
* [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>
* [dns] Fix memory leak in settings applicatorMichael Brown2011-03-031-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Remove redundant length fields in struct dhcp_packetMichael Brown2011-01-101-1/+1
| | | | | | | | 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>
* [settings] Apply settings block name in register_settings()Michael Brown2010-12-011-8/+8
| | | | | | | | 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>
* [dns] Disambiguate "no nameserver" and "no DNS record" errorsMichael Brown2010-12-011-2/+10
| | | | 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>
* [retry] Hold reference while timer is running and during expiry callbackMichael Brown2010-09-034-6/+8
| | | | | | | | | Guarantee that a retry timer cannot go out of scope while the timer is running, and provide a guarantee to the expiry callback that the timer will remain in scope during the entire callback (similar to the guarantee provided to interface methods). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xfer] Generalise metadata "whence" field to "flags" fieldMichael Brown2010-09-032-5/+5
| | | | | | | | | | | | | iPXE has never supported SEEK_END; the usage of "whence" offers only the options of SEEK_SET and SEEK_CUR and so is effectively a boolean flag. Further flags will be required to support additional metadata required by the Fibre Channel network model, so repurpose the "whence" field as a generic "flags" field. xfer_seek() has always been used with SEEK_SET, so remove the "whence" field altogether from its argument list. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [compiler] Prevent empty weak function stubs from being removedJoshua Oreman2010-08-191-1/+1
| | | | | | | | | | | | | | | | | Even with the noinline specifier added by commit 1a260f8, gcc may skip calls to non-inlinable functions that it knows have no side effects. This caused the get_cached_dhcpack() call in start_dhcp(), the weak stub of which has no code in its body, to be removed, preventing cached DHCP from working. Fix by adding a __keepme macro to compiler.h expanding to asm(""), as recommended by gcc's info page, and using it in the weak stub for get_cached_dhcpack(). Reported-by: Aaron Brooks <aaron@brooks1.net> Tested-by: Aaron Brooks <aaron@brooks1.net> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all data-xfer interfaces to generic interfacesMichael Brown2010-06-224-240/+146Star
| | | | | | | | | | | | | | Remove data-xfer as an interface type, and replace data-xfer interfaces with generic interfaces supporting the data-xfer methods. Filter interfaces (as used by the TLS layer) are handled using the generic pass-through interface capability. A side-effect of this is that deliver_raw() no longer exists as a data-xfer method. (In practice this doesn't lose any efficiency, since there are no instances within the current codebase where xfer_deliver_raw() is used to pass data to an interface supporting the deliver_raw() method.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all name-resolution interfaces to generic interfacesMichael Brown2010-06-221-6/+18
| | | | | | | | Remove name-resolution as an interface type, and replace name-resolution interfaces with generic interfaces supporting the resolv_done() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all job-control interfaces to generic interfacesMichael Brown2010-06-221-30/+16Star
| | | | | | | | | Remove job-control as an interface type, and replace job-control interfaces with generic interfaces supporting the close() method. (Both done() and kill() are absorbed into the function of close(); kill() is merely close(-ECANCELED).) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Add timer_init() wrapper functionMichael Brown2010-06-224-7/+7
| | | | | | | Standardise on using timer_init() to initialise an embedded retry timer, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_init() wrapper functionMichael Brown2010-06-224-4/+5
| | | | | | | Standardise on using ref_init() to initialise an embedded reference count, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Enable automated extraction of error usage reportsMichael Brown2010-05-311-27/+44
| | | | | | | Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use correct DHCP options on EFI systemsGeoff Lywood2010-05-291-8/+5Star
| | | | | | | | See RFC 4578 for details. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Modified-by: Michael Brown <mcb30@ipxe.org> 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-271-0/+5
| | | | | | | | | | | | | | | 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>