From owner-svn-src-head@FreeBSD.ORG Fri Jan 6 00:19:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F969106566C; Fri, 6 Jan 2012 00:19:31 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C347E8FC17; Fri, 6 Jan 2012 00:19:30 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so1800796obb.13 for ; Thu, 05 Jan 2012 16:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=E1xE1Zi+syHw9mtJHpI0iMioaU9eIKWVLirksTtF8CU=; b=SU45Wa79BxH8ix1PtmpW3IIX4MDED3pEUdY3XWxXhxIn+Bg28BPdYss8SdaoKPwU56 13L3EVuxz2QL4d9N3URd7Mg0gUAsyloaezsx5r5ot1t3/CIv0TsvrRNhbGzVk0OAUjuB zmlwcYJ/ni/0IDhsBz2UIZ/DVIlP5KEPpArBU= MIME-Version: 1.0 Received: by 10.182.78.165 with SMTP id c5mr3187458obx.60.1325809170056; Thu, 05 Jan 2012 16:19:30 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.171.67 with HTTP; Thu, 5 Jan 2012 16:19:29 -0800 (PST) In-Reply-To: <201201052229.q05MTBMf059184@svn.freebsd.org> References: <201201052229.q05MTBMf059184@svn.freebsd.org> Date: Fri, 6 Jan 2012 03:19:29 +0300 X-Google-Sender-Auth: 5D52Cw1Ijvgd_ZezHnhMeakpnQY Message-ID: From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229665 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 06 Jan 2012 00:19:31 -0000 On 6 January 2012 02:29, John Baldwin wrote: > Author: jhb > Date: Thu Jan =A05 22:29:11 2012 > New Revision: 229665 > URL: http://svn.freebsd.org/changeset/base/229665 > > Log: > =A0Remove the assertion from tcp_input() that rcv_nxt is always greater > =A0than or equal to rcv_adv and fix tcp_twstart() to handle this case by > =A0assuming the last window was zero rather than a negative value. > > =A0The code in tcp_input() already safely handled this case. =A0It can ha= ppen > =A0due to delayed ACKs along with a remote sender that sends data beyond > =A0the window we previously advertised. =A0If we have room in our socket = buffer > =A0for the extra data beyond the advertised window, we will accept it. > =A0However, if the ACK for that segment is delayed, then we will not > =A0effectively fixup rcv_adv to account for that extra data until the > =A0next segment arrives and forces out an ACK. =A0When that next segment > =A0arrives, rcv_nxt will be beyond rcv_adv. > > =A0Tested by: =A0 =A0pjd > =A0MFC after: =A0 =A01 week > > Modified: > =A0head/sys/netinet/tcp_input.c > =A0head/sys/netinet/tcp_timewait.c > > Modified: head/sys/netinet/tcp_input.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/tcp_input.c =A0 =A0 =A0 =A0Thu Jan =A05 22:28:40 201= 2 =A0 =A0 =A0 =A0(r229664) > +++ head/sys/netinet/tcp_input.c =A0 =A0 =A0 =A0Thu Jan =A05 22:29:11 201= 2 =A0 =A0 =A0 =A0(r229665) > @@ -1795,9 +1795,6 @@ tcp_do_segment(struct mbuf *m, struct tc > =A0 =A0 =A0 =A0win =3D sbspace(&so->so_rcv); > =A0 =A0 =A0 =A0if (win < 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0win =3D 0; > - =A0 =A0 =A0 KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), > - =A0 =A0 =A0 =A0 =A0 ("tcp_input negative window: tp %p rcv_nxt %u rcv_a= dv %u", tp, > - =A0 =A0 =A0 =A0 =A0 tp->rcv_nxt, tp->rcv_adv)); > =A0 =A0 =A0 =A0tp->rcv_wnd =3D imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)= ); > > =A0 =A0 =A0 =A0/* Reset receive buffer auto scaling when not in bulk rece= ive mode. */ > > Modified: head/sys/netinet/tcp_timewait.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/tcp_timewait.c =A0 =A0 Thu Jan =A05 22:28:40 2012 = =A0 =A0 =A0 =A0(r229664) > +++ head/sys/netinet/tcp_timewait.c =A0 =A0 Thu Jan =A05 22:29:11 2012 = =A0 =A0 =A0 =A0(r229665) > @@ -242,10 +242,10 @@ tcp_twstart(struct tcpcb *tp) > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Recover last window size sent. > =A0 =A0 =A0 =A0 */ > - =A0 =A0 =A0 KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), > - =A0 =A0 =A0 =A0 =A0 ("tcp_twstart negative window: tp %p rcv_nxt %u rcv= _adv %u", tp, > - =A0 =A0 =A0 =A0 =A0 tp->rcv_nxt, tp->rcv_adv)); > - =A0 =A0 =A0 tw->last_win =3D (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_sca= le; > + =A0 =A0 =A0 if (SEQ_GE(tp->rcv_adv, tp->rcv_nxt)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 tw->last_win =3D (tp->rcv_adv - tp->rcv_nxt= ) >> tp->rcv_scale; > + =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 tw->last_win =3D 0; > > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Set t_recent if timestamps are used on the connection. Hi, Looks like a typo there: /usr/src/sys/netinet/tcp_timewait.c: In function 'tcp_twstart': /usr/src/sys/netinet/tcp_timewait.c:245: warning: implicit declaration of function 'SEQ_GE' /usr/src/sys/netinet/tcp_timewait.c:245: warning: nested extern declaration of 'SEQ_GE' [-Wnested-externs] --=20 wbr, pluknet