summaryrefslogtreecommitdiffstats
path: root/src/net/tcpip.c
Commit message (Collapse)AuthorAgeFilesLines
* [netdevice] Limit MTU by hardware maximum frame lengthMichael Brown2017-01-251-2/+1Star
| | | | | | | | | | | | | | | | Separate out the concept of "hardware maximum supported frame length" and "configured link MTU", and limit the latter according to the former. In networks where the DHCP-supplied link MTU is inconsistent with the hardware or driver capabilities (e.g. a network using jumbo frames), this will result in iPXE advertising a TCP MSS consistent with a size that can actually be received. Note that the term "MTU" is typically used to refer to the maximum length excluding the link-layer headers; we adopt this usage. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Allow supported address families to be detected at runtimeMichael Brown2015-09-011-8/+7Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Fix dubious calculation of min_portMichael Brown2015-03-131-1/+1
| | | | | | Detected using sparse. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+1
| | | | | | | | | | These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Provide tcpip_mtu() to determine the maximum transmission unitMichael Brown2014-03-041-0/+29
| | | | | | | | Provide the function tcpip_mtu() to allow external code to determine the (transport-layer) maximum transmission unit for a given socket address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Provide tcpip_netdev() to determine the transmitting network deviceMichael Brown2014-03-041-10/+46
| | | | | | | Provide the function tcpip_netdev() to allow external code to determine the transmitting network device for a given socket address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Add IP statistics collection as per RFC 4293Michael Brown2014-03-021-2/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Pass through network device to transport layer protocolsMichael Brown2013-09-031-3/+5
| | | | | | | NDP requires knowledge of the network device on which a packet was received. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Allow binding to unspecified privileged ports (below 1024)Michael Brown2013-08-061-0/+44
| | | | | Originally-implemented-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Allow for architecture-specific TCP/IP checksum routinesMichael Brown2012-06-271-2/+2
| | | | | | | Calculating the TCP/IP checksum on received packets accounts for a substantial fraction of the response latency. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-3/+3
| | | | | | | | | | | 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>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [tables] Redefine methods for accessing linker tablesMichael Brown2009-03-131-15/+2Star
| | | | | | | | | | | | | | | Intel's C compiler (icc) chokes on the zero-length arrays that we currently use as part of the mechanism for accessing linker table entries. Abstract away the zero-length arrays, to make a port to icc easier. Introduce macros such as for_each_table_entry() to simplify the common case of iterating over all entries in a linker table. Represent table names as #defined string constants rather than unquoted literals; this avoids visual confusion between table names and C variable or type names, and also allows us to force a compilation error in the event of incorrect table names.
* [tcpip] Allow for transmission to multicast IPv4 addressesMichael Brown2009-01-211-4/+5
| | | | | | | | | | | When sending to a multicast address, it may be necessary to specify the source address explicitly, since the multicast destination address does not provide enough information to deduce the source address via the miniroute table. Allow the source address specified via the data-xfer metadata to be passed down through the TCP/IP stack to the IPv4 layer, which can use it as a default source address.
* pkbuff->iobuf changeoverMichael Brown2007-05-191-9/+9
| | | | | | | | Achieved via Perl using: perl -pi -e 's/pk_buff/io_buffer/g; s/Packet buffer/I\/O buffer/ig; ' \ -e 's/pkbuff\.h/iobuf.h/g; s/pkb_/iob_/g; s/_pkb/_iob/g; ' \ -e 's/pkb/iobuf/g; s/PKB/IOB/g;'
* When a network device is specified to tcpip_tx() or it's children, treatMichael Brown2007-01-161-1/+1
| | | | | | | it as a fallback network device rather than an explicitly forced network device. Clear routing table entries before re-attempting DHCP.
* Add "name" field to struct device to allow human-readable hardware deviceMichael Brown2007-01-101-8/+8
| | | | | | | | | | | names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
* Allow an explicit network device to be specified for IP-layerMichael Brown2007-01-101-2/+4
| | | | transmissions.
* Verify checksums on the RX datapath.Michael Brown2007-01-031-9/+13
| | | | Simplify checksum generation on the TX datapath.
* We don't actually have a stdio.h header file. Our printf() functions areMichael Brown2006-09-271-1/+0Star
| | | | | | | | defined in vsprintf.h. (This may change, since vsprintf.h is a non-standard name, but for now it's the one to use.) There should be no need to include vsprintf.h just for DBG() statements, since include/compiler.h forces it in for a debug build anyway.
* added stdio.h to includes for DBG compilationMarty Connor2006-09-271-0/+1
|
* Clarified packet ownership transfer between a few functions.Michael Brown2006-08-091-0/+2
| | | | | | | | | | | | | Added a large number of missing calls to free_pkb(). In the case of UDP, no received packets were ever freed, which lead to memory exhaustion remarkably quickly once pxelinux started up. In general, any function with _rx() in its name which accepts a pk_buff *must* either call free_pkb() or pass the pkb to another _rx() function (e.g. the next layer up the stack). Since the UDP (and TCP) layers don't pass packet buffers up to the higher-layer protocols (the "applications"), they must free the packet buffer after calling the application's newdata() method.
* Added features that will be required for PXE UDP support.Michael Brown2006-08-021-55/+47Star
| | | | | | | Introduced struct sockaddr_tcpip, to simplify code that deals with both IPv4 and IPv6 addresses. Reorganised parts of tcpip.c and udp.c.
* Minor changes to the network layer rx() functionsNikhil Chandru Rao2006-08-011-3/+24
|
* Remove unused functions.Michael Brown2006-08-011-36/+0Star
|
* Renamed trans_{rx,tx}() to tcpip_{rx,tx}(), since they are specific toMichael Brown2006-08-011-2/+2
| | | | | the TCP/IP protocol suite (rather than being general transport-layer functions).
* Renamed tcpip_if.[ch] to tcpip.[ch]Michael Brown2006-08-011-0/+160