From owner-freebsd-net@FreeBSD.ORG Wed Mar 19 03:34:40 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1661365 for ; Wed, 19 Mar 2014 03:34:40 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2B7780C for ; Wed, 19 Mar 2014 03:34:40 +0000 (UTC) Received: from pool-96-250-5-187.nycmny.fios.verizon.net ([96.250.5.187]:64545 helo=minion.home) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1WQ7H5-0004ZO-9j; Tue, 18 Mar 2014 23:34:39 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: socket receive buffer size & window updates From: George Neville-Neil In-Reply-To: Date: Tue, 18 Mar 2014 23:34:38 -0400 X-Mao-Original-Outgoing-Id: 416892878.511522-e5bf2ba144ca9fcb67482620684b286e Content-Transfer-Encoding: 7bit Message-Id: <91ECA466-61D8-4F7C-ABAD-D7565B8034DF@neville-neil.com> References: To: Vijay Singh X-Mailer: Apple Mail (2.1874) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 03:34:40 -0000 On Mar 11, 2014, at 13:58 , Vijay Singh wrote: > The socket option handler currently doesn't prevent connecting or connected > sockets from changing their receive buffer sizes. In particular, I ran into > a an application that sets the receive buffer size lower than what it > originally was. > > In tcp_output(), if no data is being sent, there is code that is trying to > decide if a window update is needed. > > If the socket receive buffer size was reduced after a larger window was > already advertized, or perhaps even when there is data in the receive > buffer, it seems to me that the computation in 592 could go -ve, and be > interpreted as a large window update. > > I was led to this issue after observing in packet traces that duplicate > FINs were being sent on close. I tracked it down to this check. Should this > be changed to a check like such? > Interesting. Do you have a bit of test code? Best, George