summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2010-11-11 18:41:03 +0000
committertuexen <tuexen@FreeBSD.org>2010-11-11 18:41:03 +0000
commit9596952a638851a34a28be1cbc9f30d5032aaa8f (patch)
treedf145220a5f754b1cc403e35cd064ab8d3db8fce /sys/netinet
parent6ba2297b754f9d2cd9840610b1327c746071b697 (diff)
downloadFreeBSD-src-9596952a638851a34a28be1cbc9f30d5032aaa8f.zip
FreeBSD-src-9596952a638851a34a28be1cbc9f30d5032aaa8f.tar.gz
Fix the SACK/NR-SACK generation code.
MFC after: 3 days.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctp_output.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 1e68399..50820b7 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -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;
OpenPOWER on IntegriCloud