summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_input.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2010-03-24 19:45:36 +0000
committerrrs <rrs@FreeBSD.org>2010-03-24 19:45:36 +0000
commit4938adaeeb495e1712fac448fa8a8e51cbf9494c (patch)
tree0c5f264bd34f8d3111965985704413228cb0dd9d /sys/netinet/sctp_input.c
parent8fb79807f29b026c1c60ed7e06c3b6f43f5bd3ba (diff)
downloadFreeBSD-src-4938adaeeb495e1712fac448fa8a8e51cbf9494c.zip
FreeBSD-src-4938adaeeb495e1712fac448fa8a8e51cbf9494c.tar.gz
Fix for NR-Sack code. The code was NOT working properly when
enabled. Basically most of the operations were incorrect causing bad sacks when you enabled nr-sack. The fixes range across 4 files and unifiy most of the processing so that we only test nr_sack flags to decide which type of sack to generate. Optimization left for this is to combine the sack generation code and make it capable of generating either sack thus shrinking out a routine. Reviewed by: tuexen@freebsd.org
Diffstat (limited to 'sys/netinet/sctp_input.c')
-rw-r--r--sys/netinet/sctp_input.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index ef18737..07518e4 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -1860,9 +1860,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
memset(asoc->mapping_array, 0,
asoc->mapping_array_size);
}
- /* EY 05/13/08 - nr_sack version of the above if statement */
- if (asoc->nr_mapping_array && SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)
- && asoc->peer_supports_nr_sack) {
+ if (asoc->nr_mapping_array) {
memset(asoc->nr_mapping_array, 0,
asoc->nr_mapping_array_size);
}
@@ -3515,16 +3513,10 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb,
stcb->asoc.mapping_array_base_tsn = ntohl(resp->senders_next_tsn);
memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size);
- /*
- * EY 05/13/08 - nr_sack: to keep
- * nr_mapping array be consistent
- * with mapping_array
- */
- if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && stcb->asoc.peer_supports_nr_sack) {
- stcb->asoc.highest_tsn_inside_nr_map = stcb->asoc.highest_tsn_inside_map;
- stcb->asoc.nr_mapping_array_base_tsn = stcb->asoc.mapping_array_base_tsn;
- memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.nr_mapping_array_size);
- }
+ stcb->asoc.highest_tsn_inside_nr_map = stcb->asoc.highest_tsn_inside_map;
+ stcb->asoc.nr_mapping_array_base_tsn = stcb->asoc.mapping_array_base_tsn;
+ memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.nr_mapping_array_size);
+
stcb->asoc.sending_seq = ntohl(resp->receivers_next_tsn);
stcb->asoc.last_acked_seq = stcb->asoc.cumulative_tsn;
@@ -3631,15 +3623,9 @@ sctp_handle_str_reset_request_tsn(struct sctp_tcb *stcb,
stcb->asoc.tsn_last_delivered = stcb->asoc.cumulative_tsn = stcb->asoc.highest_tsn_inside_map;
stcb->asoc.mapping_array_base_tsn = stcb->asoc.highest_tsn_inside_map + 1;
memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size);
- /*
- * EY 05/13/08 -nr_sack: to keep nr_mapping array consistent
- * with mapping array
- */
- if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && stcb->asoc.peer_supports_nr_sack) {
- stcb->asoc.highest_tsn_inside_nr_map = stcb->asoc.highest_tsn_inside_map;
- stcb->asoc.nr_mapping_array_base_tsn = stcb->asoc.highest_tsn_inside_map + 1;
- memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.nr_mapping_array_size);
- }
+ stcb->asoc.highest_tsn_inside_nr_map = stcb->asoc.highest_tsn_inside_map;
+ stcb->asoc.nr_mapping_array_base_tsn = stcb->asoc.highest_tsn_inside_map + 1;
+ memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.nr_mapping_array_size);
atomic_add_int(&stcb->asoc.sending_seq, 1);
/* save off historical data for retrans */
stcb->asoc.last_sending_seq[1] = stcb->asoc.last_sending_seq[0];
OpenPOWER on IntegriCloud