aboutsummaryrefslogtreecommitdiffstats
path: root/efi/udp.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix all warnings, and better separate code that should not be mixedsyslinux-6.04-pre3H. Peter Anvin (Intel)2019-02-071-1/+1
| | | | | | | | | Clean up a number of warnings in the tree. Refactor especially the core code so we don't end up building a bunch of BIOS-specific code for EFI, and general build cleanups. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* efi/udp: Removing the udp_reader efi_bindingJulien Viard de Galbert2017-05-311-22/+2
| | | | Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net>
* efi/udp: Add retry disabling UseDefaultAddressJulien Viard de Galbert2017-05-311-0/+12
| | | | | | | | Add retry disabling UseDefaultAddress in core_udp_connect() and core_udp_sendto() Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* efi/udp: core_udp_connect: use SubnetMask not StationAddress for netmaskJulien Viard de Galbert2017-05-311-1/+1
| | | | | Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* efi/udp: correct typo of SubnetMaskGene Cumm2016-02-291-1/+1
| | | | | | | Used wrong variable. Reported-By: Patrick Masotta <masottaus@yahoo.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* efi: Disable UseDefaultAddress if possibly deafGene Cumm2015-10-151-3/+28
| | | | | | | Some machines don't like UseDefaultAddress; fallback to manually configuring. HP EFI servers like DL160 Gen9 are affected. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* efi: core_udp_configure()/core_tcp_connect(): Fix error messageGene Cumm2015-10-121-1/+1
| | | | | | Wrong translation type used. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* efi/udp: Don't use AllowPromiscuousGene Cumm2015-07-181-2/+0
| | | | | | | Unnecessary. On some systems, opens NIC in promiscuous mode or breaks UseDefaultAddress. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* efi: Provide feedback on Configure() failuresGene Cumm2015-07-181-3/+5
| | | | | | | There are more unsuccessful returns that are ignored. Restructure to allow for trapping other values. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* Merge remote-tracking branch 'zytor/firmware' into masterGene Cumm2014-01-291-0/+4
|\ | | | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * efi: Add Intel copyright noticesfirmwareMatt Fleming2014-01-241-0/+4
| | | | | | | | Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | efi/udp: zero token in recvGene Cumm2014-01-291-0/+1
| | | | | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | efi: Loop on Configure when EFI_NO_MAPPING in udp.c/tcp.cGene Cumm2014-01-291-7/+39
| | | | | | | | | | | | | | This should help hardware that doesn't return EFI_SUCCESS immediately. Reported-by: Jason Matthews <jason.david.matthews@gmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | efu/udp: Unset modeGene Cumm2014-01-291-2/+0
| | | | | | | | | | | | udata.AcceptAnyPort caused the udata.StationPort to return as 0. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | efi: UseDefaultAddress in udp.c/tcp.cGene Cumm2014-01-291-4/+2
| | | | | | | | | | | | | | We don't need to re-inform EFI what IPv4 address and subnet mask to use. This change should help to re-use the exising routes. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | efi/udp.c: Use existing UDP port in core_udp_sendto()Celelibi2014-01-291-0/+3
| | | | | | | | | | | | | | core_udp_open() obtained a port allocation. Continue using it. Author: Celelibi <celelibi@gmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | efi/udp.c: Save UDP Port in core_udp_open()H. Peter Anvin2014-01-291-15/+12
|/ | | | | | | | core_udp_open() should obtain a UDP port allocation and save it for core_udp_connect() and core_udp_sendto() to reuse. Author: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* Merge branch 'elflink-pxe-fixes-for-mfleming-2' of ↵Matt Fleming2013-09-301-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | git://github.com/geneC/syslinux into firmware Pull various network stack fixes from Gene Cumm and adapt to the 6.xx core_udp_* API, * 'elflink-pxe-fixes-for-mfleming-2' of git://github.com/geneC/syslinux: PXE ISR: Force polling on select hardware WORKAROUND core/lwip: Fix NULL pointer check PXE: use ddprintf macro com32: Define ddprintf() macro PXELINUX: specify PXE/lwIP undiif: show thread of execution on UNDIIF_ID_DEBUG core: dprintf() the banner. PXELINUX: Use sendto() instead of connect()/send()/disconnect() core: make mbox_post()/__sem_down_slow() check if valid core: mbox/semaphore NULL checks core/lwip/undi: Improve UNDIIF_ID_DEBUG messages Conflicts: core/fs/pxe/pxe.c core/fs/pxe/tftp.c core/init.c
* efi, udp: implement receive timeoutsyslinux-6.02-pre5Matt Fleming2013-07-121-1/+16
| | | | | | | | | | We currently wait indefinitely in core_udp_recv() when reading packets. Implement a timeout, which is what all the other network stacks do. By timing out we are now able to handle packet loss on the network, e.g. we'll now re-send TFTP requests instead of waiting for ACK packets that will never come. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* efi, udp: fill out the IP TTL fieldsyslinux-6.01-pre3Matt Fleming2013-06-261-0/+1
| | | | | | | | | Some firmware implementations fill out a default value for the Time To Live field when none is set, others do not. Since the UEFI specification doesn't mandate that the firmware set this field, we need to do it ourselves. Pick the recommended value of 64. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* efi, udp: use single local port for each connectionsyslinux-6.01-pre2Matt Fleming2013-06-261-22/+54
| | | | | | | | | | | | | | | | | | | | | | | The TFTP protocol uses the local port as an idenitifer during a transfer (TID), which means that once we've established a TFTP connection, we must ensure we reuse the same local port number in each packet. Failure to do so is an error, which causes the TFTP server to send an error packet. From RFC 1350 - THE TFTP PROTOCOL (REVISION 2), Section 4, In the next step, and in all succeeding steps, the hosts should make sure that the source TID matches the value that was agreed on in steps 1 and 2. If a source TID does not match, the packet should be discarded as erroneously sent from somewhere else. An error packet should be sent to the source of the incorrect packet, while not disturbing the transfer. Once the UDPv4 protocol driver has been assigned a local port number (which happens on the first core_udp_connect()) reuse that number until core_udp_close() time. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* efi: Add network supportsyslinux-6.00-pre5Matt Fleming2013-04-231-0/+251
Add TCP and UDP support to the EFI firmware backend. This necessitated moving all tcp functions to a core_tcp_* prefix so that they could be implemented differently for BIOS+lwip and EFI. Unfortunately, the tcp_* prefix is already in use by the lwip code. To maintain symmetry, the UDP functions were also moved from net_core_* to core_udp_*. The net_core API was introduced in 5.x to allow the legacy PXE and lwip stacks to live side by side, and the intention was that net_core_init() would take a protocol argument to build a protocol-specific object. It turned out to be easier to call either udp or tcp functions directly because the semantics of read/write differ between protocols. Booting an IPv4 EFI PXE stack using tftp and http has been tested. There are a couple of TODO items left, o dns resolve code is missing o ftp hasn't been tested Signed-off-by: Matt Fleming <matt.fleming@intel.com>