kern/173309: [tcp] TCP connections often prematurely closed by the server side after r242262 [regression]

Andre Oppermann andre at freebsd.org
Sun Nov 4 00:39:59 UTC 2012


Hello Fabian,

thank you for the bug report.  Please try the attached patch
which should fix the issue you observed.

-- 
Andre

Index: tcp_input.c
===================================================================
--- tcp_input.c (revision 242494)
+++ tcp_input.c (working copy)
@@ -2650,10 +2652,12 @@

                 SOCKBUF_LOCK(&so->so_snd);
                 if (acked > so->so_snd.sb_cc) {
+                       tp->snd_wnd -= so->so_snd.sb_cc;
                         sbdrop_locked(&so->so_snd, (int)so->so_snd.sb_cc);
                         ourfinisacked = 1;
                 } else {
                         sbdrop_locked(&so->so_snd, acked);
+                       tp->snd_wnd -= acked;
                         ourfinisacked = 0;
                 }
                 /* NB: sowwakeup_locked() does an implicit unlock. */


More information about the freebsd-net mailing list