]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
tcp: ack when we get an OOO/lost packet
authorJosef Bacik <jbacik@fb.com>
Wed, 12 Aug 2015 15:16:22 +0000 (08:16 -0700)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Mon, 7 Dec 2015 17:52:27 +0000 (20:52 +0300)
While adding tcp window scaling support I was finding that I'd get some packet
loss or reordering when transferring from large distances and grub would just
timeout.  This is because we weren't ack'ing when we got our OOO packet, so the
sender didn't know it needed to retransmit anything, so eventually it would fill
the window and stop transmitting, and we'd time out.  Fix this by ACK'ing when
we don't find our next sequence numbered packet.  With this fix I no longer time
out.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
grub-core/net/tcp.c

index 9e81a0a8545a664793dd6a976732ea4ade776148..576f684982aa13e18b434312eae1c66306e091fd 100644 (file)
@@ -893,7 +893,10 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb,
          grub_priority_queue_pop (sock->pq);
        }
       if (grub_be_to_cpu32 (tcph->seqnr) != sock->their_cur_seq)
-       return GRUB_ERR_NONE;
+       {
+         ack (sock);
+         return GRUB_ERR_NONE;
+       }
       while (1)
        {
          nb_top_p = grub_priority_queue_top (sock->pq);