lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] [PATCH] tcp: Avoid 3-second delay for a half-open conne


From: Simon Goldschmidt
Subject: Re: [lwip-devel] [PATCH] tcp: Avoid 3-second delay for a half-open connection
Date: Mon, 4 Jul 2016 10:20:34 +0200

Thanks for reporting, I've added this as patch #9039 (https://savannah.nongnu.org/patch/index.php?9039).
 
Simon
 
Gesendet: Montag, 04. Juli 2016 um 09:25 Uhr
Von: "Michael Brown" <address@hidden>
An: address@hidden
Cc: "Michael Brown" <address@hidden>
Betreff: [lwip-devel] [PATCH] tcp: Avoid 3-second delay for a half-open connection
If lwIP encounters a half-open connection (e.g. due to a restarted
application reusing the same port numbers) it will correctly send a
RST but will not resend the SYN until one retransmission timeout later
(approximately three seconds). This can increase the time taken by
lpxelinux.0 to fetch its configuration file from a few milliseconds to
around 30 seconds.

Fix by immediately retransmitting the SYN whenever a half-open
connection is detected.

Signed-off-by: Michael Brown <address@hidden>
---
src/core/tcp_in.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c
index f291887..5e7f2cd 100644
--- a/src/core/tcp_in.c
+++ b/src/core/tcp_in.c
@@ -812,6 +812,9 @@ tcp_process(struct tcp_pcb *pcb)
/* send a RST to bring the other side in a non-synchronized state. */
tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(),
ip_current_src_addr(), tcphdr->dest, tcphdr->src);
+ /* Resend SYN immediately to establish connection */
+ pcb->rtime = 0;
+ tcp_rexmit_rto(pcb);
}
break;
case SYN_RCVD:
--
2.3.8


_______________________________________________
lwip-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]