]> git.dujemihanovic.xyz Git - u-boot.git/commit
net: wget: Support retransmission a dropped packet
authorYasuharu Shibata <yasuharu.shibata@gmail.com>
Sun, 14 Apr 2024 10:46:07 +0000 (19:46 +0900)
committerTom Rini <trini@konsulko.com>
Tue, 16 Apr 2024 23:19:29 +0000 (17:19 -0600)
commitcab7867cff33f9c21025102ea9ca3b26e362fb52
treee5f50661ebca69943b2f4e2db4623124a0e2ee36
parent6e316e3f397b5e01e98c5dd56cdbaab961daeedf
net: wget: Support retransmission a dropped packet

The server sends multiple packets without waiting for an ACK
by window control and if some packets are dropped,
wget will return an ACK including the dropped packets.

Following log indicates this issue.

  wget_handler() wget: Transferring, seq=97bbdd4a, ack=30,len=580
  wget_handler() wget: Transferring, seq=97bbedca, ack=30,len=580

First packet of TCP sequence number is 0x97bbdd4a.
Second packet of TCP sequence number should be 0x97bbe2ca,
however it is 0x97bbedca and returns its ACK, so the server
suppose that 0x97bbe2ca and 0x97bbedca are received appropriately.
In this case, 0x97bbe2ca was lost and the data of wget was broken.

In this patch, next_data_seq_num holds the next expected
TCP sequence number.
If the TCP sequence number different from next_data_seq_num,
trying to retransmit the packet.

Signed-off-by: Yasuharu Shibata <yasuharu.shibata@gmail.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
net/wget.c