Date: Thu, 11 Nov 2010 18:41:03 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r215134 - head/sys/netinet Message-ID: <201011111841.oABIf32X080588@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Thu Nov 11 18:41:03 2010 New Revision: 215134 URL: http://svn.freebsd.org/changeset/base/215134 Log: Fix the SACK/NR-SACK generation code. MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Nov 11 18:35:28 2010 (r215133) +++ head/sys/netinet/sctp_output.c Thu Nov 11 18:41:03 2010 (r215134) @@ -10118,19 +10118,18 @@ sctp_send_sack(struct sctp_tcb *stcb) } } - if (((type == SCTP_SELECTIVE_ACK) && - (((asoc->mapping_array[0] | asoc->nr_mapping_array[0]) & 0x01) == 0x00)) || - ((type == SCTP_NR_SELECTIVE_ACK) && - ((asoc->mapping_array[0] & 0x01) == 0x00))) { - sel_start = 0; - } else { - sel_start = 1; - } if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { offset = 1; } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } + if ((offset == 1) || + ((type == SCTP_NR_SELECTIVE_ACK) && + ((asoc->mapping_array[0] & (1 << (1 - offset))) == 0))) { + sel_start = 0; + } else { + sel_start = 1; + } if (((type == SCTP_SELECTIVE_ACK) && compare_with_wrap(highest_tsn, asoc->cumulative_tsn, MAX_TSN)) || ((type == SCTP_NR_SELECTIVE_ACK) && @@ -10200,7 +10199,7 @@ sctp_send_sack(struct sctp_tcb *stcb) siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + asoc->highest_tsn_inside_nr_map + 7) / 8; } - if ((asoc->nr_mapping_array[0] & 0x01) == 0x00) { + if ((asoc->nr_mapping_array[0] & (1 << (1 - offset))) == 0) { sel_start = 0; } else { sel_start = 1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011111841.oABIf32X080588>