From owner-freebsd-net@FreeBSD.ORG Sun Nov 4 00:39:58 2012 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4794B6 for ; Sun, 4 Nov 2012 00:39:58 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 3C5F58FC14 for ; Sun, 4 Nov 2012 00:39:57 +0000 (UTC) Received: (qmail 37294 invoked from network); 4 Nov 2012 02:15:52 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 4 Nov 2012 02:15:52 -0000 Message-ID: <5095B953.9060301@freebsd.org> Date: Sun, 04 Nov 2012 01:39:47 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Fabian Keil Subject: Re: kern/173309: [tcp] TCP connections often prematurely closed by the server side after r242262 [regression] References: <201211032251.qA3Mpnp6017076@freefall.freebsd.org> In-Reply-To: <201211032251.qA3Mpnp6017076@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@FreeBSD.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 00:39:59 -0000 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. */