summaryrefslogtreecommitdiffstats
path: root/src/net/ipv6.c
Commit message (Collapse)AuthorAgeFilesLines
* [build] Fix the REQUIRE_SYMBOL mechanismMichael Brown2015-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | At some point in the past few years, binutils became more aggressive at removing unused symbols. To function as a symbol requirement, a relocation record must now be in a section marked with @progbits and must not be in a section which gets discarded during the link (either via --gc-sections or via /DISCARD/). Update REQUIRE_SYMBOL() to generate relocation records meeting these criteria. To minimise the impact upon the final binary size, we use existing symbols (specified via the REQUIRING_SYMBOL() macro) as the relocation targets where possible. We use R_386_NONE or R_X86_64_NONE relocation types to prevent any actual unwanted relocation taking place. Where no suitable symbol exists for REQUIRING_SYMBOL() (such as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to generate a one-byte-long symbol to act as the relocation target. If there are versions of binutils for which this approach fails, then the fallback will probably involve killing off REQUEST_SYMBOL(), redefining REQUIRE_SYMBOL() to use the current definition of REQUEST_SYMBOL(), and postprocessing the linked ELF file with something along the lines of "nm -u | wc -l" to check that there are no undefined symbols remaining. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Avoid potentially copying from a NULL pointer in ipv6_tx()Michael Brown2014-05-231-1/+2
| | | | | | | | | | | | | If ipv6_tx() is called with a non-NULL network device, a NULL or unspecified source address, and a destination address which does not match any routing table entry, then it will attempt to copy the source address from a NULL pointer. I don't think that there is currently any code path which could trigger this behaviour, but we should probably ensure that it can never happen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Include network device when transcribing multicast addressesMichael Brown2014-05-231-1/+1
| | | | | | | Destination multicast addresses require a sin6_scope_id, which should therefore be transcribed to a network device name by ipv6_sock_ntoa(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Provide tcpip_mtu() to determine the maximum transmission unitMichael Brown2014-03-041-0/+1
| | | | | | | | 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-0/+20
| | | | | | | 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-9/+43
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Allow for IPv6 setting types in non-IPv6 buildsMichael Brown2013-12-051-12/+5Star
| | | | | | | | | Allow for the existence of references to IPv6 setting types without dragging in the whole IPv6 stack, by placing the definition of setting_type_ipv6 in core/settings.c and providing weak stub methods for parse_ipv6_setting() and format_ipv6_setting(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-051-3/+3
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Separate the concepts of prefix and address creationMichael Brown2013-11-151-84/+120
| | | | | | | | Allow for IPv6 routing table entries to be created for an on-link prefix where a local address has not yet been assigned to the network device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add "ipv6" setting typeMichael Brown2013-11-141-0/+53
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Use given source address only if it is not the unspecified addressMichael Brown2013-11-141-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Make all net_driver methods optionalMichael Brown2013-11-011-11/+0Star
| | | | | | | | Most network upper-layer drivers do not implement all three methods (probe, notify, and remove). Save code by making all methods optional. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add ndp_tx_router_solicitation() to send router solicitationsMichael Brown2013-10-251-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Automatically choose source for link-local and multicast destinationsMichael Brown2013-10-251-30/+34
| | | | | | | | When transmitting to a link-local or multicast destination address, use the network device's link-local address as the source address if no explicit source address has been specified. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Treat sin6_scope_id consistentlyMichael Brown2013-10-251-3/+3
| | | | | | | sin6_scope_id is never exposed outside of the local system, and so should be a native-endian quantity. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Support stateless address autoconfiguration (SLAAC)Michael Brown2013-10-231-0/+47
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Handle IPv6 option length correctlyMichael Brown2013-10-231-1/+1
| | | | | | | The IPv6 option length field represents the length of the option data field, not the overall length of the option. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add IPv6 socket address converterMichael Brown2013-10-211-1/+98
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add inet6_aton()Michael Brown2013-09-111-4/+73
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Replace IPv6 stackMichael Brown2013-09-031-249/+630
| | | | | | | | | | | | | | | | Replace the existing partially-implemented IPv6 stack with a fresh implementation. This implementation is not yet complete. The IPv6 transmit and receive datapaths are functional (including fragment reassembly and parsing of arbitrary extension headers). NDP neighbour solicitations and advertisements are supported. ICMPv6 echo is supported. At present, only link-local addresses may be used, and there is no way to specify an IPv6 address as part of a URI (either directly or via a DNS lookup). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Pass through network device to transport layer protocolsMichael Brown2013-09-031-3/+4
| | | | | | | NDP requires knowledge of the network device on which a packet was received. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Rename sin_{family,port} to sin6_{family,port} in struct sockaddr_in6Michael Brown2013-08-061-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow link layer to report broadcast/multicast packets via pull()Michael Brown2011-07-151-1/+3
| | | | | | | | 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>
* [netdevice] Pass both link-layer addresses in net_tx() and net_rx()Michael Brown2010-10-071-1/+4
| | | | | | | | | 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>
* [build] Fix misaligned table entries when using gcc 4.5Piotr Jaroszyński2010-08-201-2/+0Star
| | | | | | | | | | Declarations without the accompanying __table_entry cause misalignment of the table entries when using gcc 4.5. Fix by adding the appropriate __table_entry macro or (where possible) by removing unnecessary forward declarations. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-10/+10
| | | | | | | | | | | 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>
* [tcpip] Allow for transmission to multicast IPv4 addressesMichael Brown2009-01-211-0/+1
| | | | | | | | | | | 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.
* Various warnings fixups for OpenBSD with gcc-3.3.5.Michael Brown2007-12-071-1/+1
|
* Merge commit 'holger/strings'Michael Brown2007-08-231-5/+4Star
|\
| * use malloc attributeHolger Lubitz2007-08-201-5/+4Star
| |
* | fix gcc 4.2.1 warning: initialized field overwrittenHolger Lubitz2007-08-021-4/+1Star
|/
* Warnings purge: src/{crypto,hci,net}Marty Connor2007-07-031-4/+4
|
* Kill off hotplug.h and just make net devices normal reference-countedMichael Brown2007-06-271-22/+2Star
| | | | | | structures. DHCP still broken and #if 0'd out.
* pkbuff->iobuf changeoverMichael Brown2007-05-191-25/+25
| | | | | | | | 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;'
* Use stdio.h instead of vsprintf.hMichael Brown2007-01-191-1/+1
|
* Include stdlib.h rather than malloc.hMichael Brown2007-01-181-1/+0Star
|
* Use -ENETUNREACH to mean "no reachable network device exists, don't botherMichael Brown2007-01-141-1/+1
| | | | retrying".
* Allow an explicit network device to be specified for IP-layerMichael Brown2007-01-101-1/+1
| | | | transmissions.
* IPv6 minirouting table entries hold persistent references to net devices.Michael Brown2007-01-041-17/+78
|
* Verify checksums on the RX datapath.Michael Brown2007-01-031-9/+7Star
| | | | Simplify checksum generation on the TX datapath.
* IP6 supportNikhil Chandru Rao2006-08-191-14/+309
|
* Remove _PROTOCOL macros for gcc 3.2 compatibilityMarty Connor2006-08-091-6/+2Star
|
* Added features that will be required for PXE UDP support.Michael Brown2006-08-021-11/+8Star
| | | | | | | 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-2/+36
|
* Split ipv6 functions out from ipv4.cMichael Brown2006-06-261-0/+24