From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 21:01:03 2010 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 5FF4F106566C; Thu, 16 Dec 2010 21:01:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 346318FC13; Thu, 16 Dec 2010 21:01:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGL13RZ088360; Thu, 16 Dec 2010 21:01:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGL13CZ088357; Thu, 16 Dec 2010 21:01:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012162101.oBGL13CZ088357@svn.freebsd.org> From: Michael Tuexen Date: Thu, 16 Dec 2010 21:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216495 - 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: Thu, 16 Dec 2010 21:01:03 -0000 Author: tuexen Date: Thu Dec 16 21:01:02 2010 New Revision: 216495 URL: http://svn.freebsd.org/changeset/base/216495 Log: Bugfix: Take also the nr-mapping array into account when detecting gaps. Reviewed by: rrs@ MFC after: 3 days. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Dec 16 19:48:03 2010 (r216494) +++ head/sys/netinet/sctp_indata.c Thu Dec 16 21:01:02 2010 (r216495) @@ -2585,8 +2585,9 @@ sctp_process_data(struct mbuf **mm, int int num_chunks = 0; /* number of control chunks processed */ int stop_proc = 0; int chk_length, break_flag, last_chunk; - int abort_flag = 0, was_a_gap = 0; + int abort_flag = 0, was_a_gap; struct mbuf *m; + uint32_t highest_tsn; /* set the rwnd */ sctp_set_rwnd(stcb, &stcb->asoc); @@ -2594,11 +2595,12 @@ sctp_process_data(struct mbuf **mm, int m = *mm; SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; - if (compare_with_wrap(stcb->asoc.highest_tsn_inside_map, - stcb->asoc.cumulative_tsn, MAX_TSN)) { - /* there was a gap before this data was processed */ - was_a_gap = 1; + if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map, MAX_TSN)) { + highest_tsn = asoc->highest_tsn_inside_nr_map; + } else { + highest_tsn = asoc->highest_tsn_inside_map; } + was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); /* * setup where we got the last DATA packet from for any SACK that * may need to go out. Don't bump the net. This is done ONLY when a Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Dec 16 19:48:03 2010 (r216494) +++ head/sys/netinet/sctp_input.c Thu Dec 16 21:01:02 2010 (r216495) @@ -5650,13 +5650,15 @@ sctp_common_input_processing(struct mbuf */ } if ((data_processed == 0) && (fwd_tsn_seen)) { - int was_a_gap = 0; + int was_a_gap; + uint32_t highest_tsn; - if (compare_with_wrap(stcb->asoc.highest_tsn_inside_map, - stcb->asoc.cumulative_tsn, MAX_TSN)) { - /* there was a gap before this data was processed */ - was_a_gap = 1; + if (compare_with_wrap(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map, MAX_TSN)) { + highest_tsn = stcb->asoc.highest_tsn_inside_nr_map; + } else { + highest_tsn = stcb->asoc.highest_tsn_inside_map; } + was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); stcb->asoc.send_sack = 1; sctp_sack_check(stcb, was_a_gap, &abort_flag); if (abort_flag) {