From 96bd62413f8781ca5d5c0d3f9ba82463f568d06a Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 5 Oct 2011 17:50:52 +0200 Subject: [PATCH] Don't set RST in response to empty packets --- grub-core/net/tcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c index 7f120ac16..cb5b6a698 100644 --- a/grub-core/net/tcp.c +++ b/grub-core/net/tcp.c @@ -764,11 +764,11 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb, grub_netbuff_free (nb); return GRUB_ERR_NONE; } - if (sock->i_reseted) + if (sock->i_reseted && (nb->tail - nb->data + - (grub_be_to_cpu16 (tcph->flags) + >> 12) * sizeof (grub_uint32_t)) > 0) { reset (sock); - grub_netbuff_free (nb); - return GRUB_ERR_NONE; } err = grub_priority_queue_push (sock->pq, &nb);