From owner-svn-src-head@FreeBSD.ORG Wed Jun 10 21:32:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CAD7473; Wed, 10 Jun 2015 21:32:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67B121964; Wed, 10 Jun 2015 21:32:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [137.122.64.24]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B0965B979; Wed, 10 Jun 2015 17:32:30 -0400 (EDT) Message-ID: <5578ACEC.2070209@FreeBSD.org> Date: Wed, 10 Jun 2015 17:32:28 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Julien Charbon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284245 - head/sys/netinet References: <201506102043.t5AKh8YB058825@svn.freebsd.org> In-Reply-To: <201506102043.t5AKh8YB058825@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 10 Jun 2015 17:32:31 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2015 21:32:32 -0000 On 6/10/15 4:43 PM, Julien Charbon wrote: > Author: jch > Date: Wed Jun 10 20:43:07 2015 > New Revision: 284245 > URL: https://svnweb.freebsd.org/changeset/base/284245 > > Log: > Fix a callout race condition introduced in TCP timers callouts with r281599. > In TCP timer context, it is not enough to check callout_stop() return value > to decide if a callout is still running or not, previous callout_reset() > return values have also to be checked. > > Differential Revision: https://reviews.freebsd.org/D2763 > Reviewed by: hiren > Approved by: hiren > MFC after: 1 day > Sponsored by: Verisign, Inc. > > Modified: > head/sys/netinet/tcp_timer.c > head/sys/netinet/tcp_timer.h > > Modified: head/sys/netinet/tcp_timer.c > ============================================================================== > --- head/sys/netinet/tcp_timer.c Wed Jun 10 20:11:28 2015 (r284244) > +++ head/sys/netinet/tcp_timer.c Wed Jun 10 20:43:07 2015 (r284245) > @@ -347,11 +347,12 @@ tcp_timer_2msl(void *xtp) > tp = tcp_close(tp); > } else { > if (tp->t_state != TCPS_TIME_WAIT && > - ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) > - callout_reset_on(&tp->t_timers->tt_2msl, > - TP_KEEPINTVL(tp), tcp_timer_2msl, tp, > - inp_to_cpuid(inp)); > - else > + ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { > + if (!callout_reset(&tp->t_timers->tt_2msl, > + TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { > + tp->t_timers->tt_flags &= ~TT_2MSL_RST; > + } > + } else > tp = tcp_close(tp); Did you mean to use callout_reset() instead of callout_reset_on() here and elsewhere in this change? -- John Baldwin