From owner-svn-src-stable-9@FreeBSD.ORG Fri Jan 13 20:35:13 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7084E106566B; Fri, 13 Jan 2012 20:35:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 504A58FC14; Fri, 13 Jan 2012 20:35:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0DKZDqr079490; Fri, 13 Jan 2012 20:35:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKZDEm079487; Fri, 13 Jan 2012 20:35:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132035.q0DKZDEm079487@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230086 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:35:13 -0000 Author: jhb Date: Fri Jan 13 20:35:12 2012 New Revision: 230086 URL: http://svn.freebsd.org/changeset/base/230086 Log: MFC 229665,229672,229700: Remove the assertion from tcp_input() that rcv_nxt is always greater than or equal to rcv_adv and fix tcp_twstart() to handle this case by assuming the last window was zero rather than a negative value. The code in tcp_input() already safely handled this case. It can happen due to delayed ACKs along with a remote sender that sends data beyond the window we previously advertised. If we have room in our socket buffer for the extra data beyond the advertised window, we will accept it. However, if the ACK for that segment is delayed, then we will not effectively fixup rcv_adv to account for that extra data until the next segment arrives and forces out an ACK. When that next segment arrives, rcv_nxt will be beyond rcv_adv. Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_timewait.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jan 13 20:28:11 2012 (r230085) +++ stable/9/sys/netinet/tcp_input.c Fri Jan 13 20:35:12 2012 (r230086) @@ -1826,9 +1826,6 @@ tcp_do_segment(struct mbuf *m, struct tc win = sbspace(&so->so_rcv); if (win < 0) win = 0; - KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), - ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_nxt, tp->rcv_adv)); tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); /* Reset receive buffer auto scaling when not in bulk receive mode. */ Modified: stable/9/sys/netinet/tcp_timewait.c ============================================================================== --- stable/9/sys/netinet/tcp_timewait.c Fri Jan 13 20:28:11 2012 (r230085) +++ stable/9/sys/netinet/tcp_timewait.c Fri Jan 13 20:35:12 2012 (r230086) @@ -242,10 +242,10 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ - KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), - ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_nxt, tp->rcv_adv)); - tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) + tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; + else + tw->last_win = 0; /* * Set t_recent if timestamps are used on the connection.