mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-27 22:56:49 +08:00
1dd034ec00
Option Acknowledgment (OACK) is an extension of TFTP protocol (see rfc2347). Not all tftp servers implements it. For example it does not supported by tftpd server from debian-11 (https://packages.debian.org/bullseye/tftpd). Starting the "tftpput $loadaddr $size out_file" command with such server will results in the following packets flow: 192.168.27.3 192.168.27.1 TFTP Write Request, ... 192.168.27.1 192.168.27.3 TFTP Acknowledgement, Block: 0 192.168.27.3 192.168.27.1 TFTP Write Request, ... 192.168.27.1 192.168.27.3 TFTP Acknowledgement, Block: 0 192.168.27.3 192.168.27.1 TFTP Write Request, ... 192.168.27.1 192.168.27.3 TFTP Acknowledgement, Block: 0 192.168.27.1 192.168.27.3 TFTP Acknowledgement, Block: 0 192.168.27.1 192.168.27.3 TFTP Acknowledgement, Block: 0 ... so, no data transfer happening. Here is a packets flow for tftp-server with OACK support (tftpd-hpa: https://packages.debian.org/stable/tftpd-hpa) 192.168.27.3 192.168.27.1 TFTP Write Request, ... 192.168.27.1 192.168.27.3 TFTP Option Acknowledgement, ... 192.168.27.3 192.168.27.1 TFTP Data Packet, Block: 1 192.168.27.1 192.168.27.3 TFTP Acknowledgement, Block: 1 192.168.27.3 192.168.27.1 TFTP Data Packet, Block: 2 192.168.27.1 192.168.27.3 TFTP Acknowledgement, Block: 2 and this time data transfer starts normally. As we can see there is no OACK packet in the first case. Investigating an issue we'll find out: 1) tftp_start() sets tftp_state = STATE_SEND_WRQ; 2) on OACK tftp_handler() sets tftp_state = STATE_DATA; and send a first DATA packet. 3) on ACK tftp_handler() will call a tftp_send() function. tftp_send() will * tftpd with OACK support: Current state is STATE_DATA, so transmittion of data packet will happen. * tftpd without OACK support Current state is STATE_SEND_WRQ, so retransmission of WRQ packet will happen. Thus tftpd-server will retransmit an ACK. This will repeats until timeout happens. According to RFC1350 this is wrong. We should start data transfer instead of WRQ retransmission. This patch fix an issue, so tftpput works fine with both types of servers. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> |
||
---|---|---|
.. | ||
arp.c | ||
arp.h | ||
bootp.c | ||
bootp.h | ||
cdp.c | ||
cdp.h | ||
dhcpv6.c | ||
dhcpv6.h | ||
dns.c | ||
dns.h | ||
dsa-uclass.c | ||
eth_bootdev.c | ||
eth_common.c | ||
eth_internal.h | ||
eth-uclass.c | ||
fastboot_tcp.c | ||
fastboot_udp.c | ||
Kconfig | ||
link_local.c | ||
link_local.h | ||
Makefile | ||
mdio-mux-uclass.c | ||
mdio-uclass.c | ||
ndisc.c | ||
net6.c | ||
net_rand.h | ||
net.c | ||
nfs.c | ||
nfs.h | ||
pcap.c | ||
ping6.c | ||
ping.c | ||
ping.h | ||
rarp.c | ||
rarp.h | ||
sntp.c | ||
tcp.c | ||
tftp.c | ||
udp.c | ||
wget.c | ||
wol.c | ||
wol.h |