Date: Thu, 11 Jun 2009 09:07:02 -0400 From: John Baldwin <jhb@freebsd.org> To: Bruce Evans <brde@optusnet.com.au> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193941 - head/sys/netinet Message-ID: <200906110907.02874.jhb@freebsd.org> In-Reply-To: <20090611135433.K21177@delplex.bde.org> References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <200906101442.20988.jhb@freebsd.org> <20090611135433.K21177@delplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 11 June 2009 12:04:32 am Bruce Evans wrote: > On Wed, 10 Jun 2009, John Baldwin wrote: > > > On Wednesday 10 June 2009 2:27:15 pm John Baldwin wrote: > >> Author: jhb > >> Date: Wed Jun 10 18:27:15 2009 > >> New Revision: 193941 > >> URL: http://svn.freebsd.org/changeset/base/193941 > >> > >> Log: > >> Change a few members of tcpcb that store cached copies of ticks to be ints > >> instead of unsigned longs. This fixes a few overflow edge cases on 64-bit > >> platforms. Specifically, if an idle connection receives a packet shortly > >> before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep > >> alive timer fires after 2^31 clock ticks, the keep alive timer will think > >> that the connection has been idle for a very long time and will immediately > >> drop the connection instead of sending a keep alive probe. > >> > >> Reviewed by: silby, gnn, lstewart > >> MFC after: 1 week > > > > Note that the MFC patch for 7 is very different. I can't change the members > > to int in 7 since tcpcb is part of the ABI (for netstat, etc.). So, for 7 I > > added explicit casts in the math operations using t_rcvtime and ticks. > > That has a better chance of working too. I tested both patches by cranking the keep alive timers to 5 seconds and manually adjusting ticks to INT_MAX - 15000. Then I letting a TCP connection sit idle while ticks wrapped around to -ve. Without either patch the connection always died with ETIMEDOUT. With each patch (including what was committed above), the connection survived and the keepalive timer sent a probe instead of dropping the connection. Thus, both patches "work". -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906110907.02874.jhb>