lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Zero sstresh bug, proposed patch


From: Per-Henrik Lundblom
Subject: [lwip-users] Zero sstresh bug, proposed patch
Date: Fri, 8 Jun 2007 10:35:39 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hi,

When heavily opening and closing the tcp receive window on one side of a
TCP connection, I ran into the problem with the TCP sstresh value being
set to 0 resulting in a stop of transmission. My interpretion of the
TCP standards (carefully studying of TCP/IP Illustrated) is that sstresh
never should be assigned a value less than one MSS. Adding zero value
check to the code solved all the transmissions stops.

My proposed patch against 1.2.0 is:

--- lwip-1.2.0/src/core/tcp_in.c        2006-08-18 12:18:42.000000000
+0200
+++ lwip-1.2.0_patched/src/core/tcp_in.c        2007-06-08
10:24:42.451875000 +0200
@@ -678,6 +678,9 @@
               pcb->ssthresh = pcb->snd_wnd / 2;
             else
               pcb->ssthresh = pcb->cwnd / 2;
+
+            if (pcb->sstresh == 0)
+              pcb->sstresh = pcb->mss;

             pcb->cwnd = pcb->ssthresh + 3 * pcb->mss;
             pcb->flags |= TF_INFR;

Regards,

PH

--
Per-Henrik Lundblom           epost: address@hidden
telefon: 0733-20 71 26        hemsida: www.whatever.nu





reply via email to

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