diff options
author | tuexen <tuexen@FreeBSD.org> | 2010-12-22 17:59:38 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2010-12-22 17:59:38 +0000 |
commit | c17bd2abe06cae94dd7c76d82b5484b79b746af2 (patch) | |
tree | 80303e0e707760d51274d8c8dfdfdf5f3083faab /sys/netinet/sctp_cc_functions.c | |
parent | aa42d9f67fb8820598ba9b01c9f9de9a6525eba1 (diff) | |
download | FreeBSD-src-c17bd2abe06cae94dd7c76d82b5484b79b746af2.zip FreeBSD-src-c17bd2abe06cae94dd7c76d82b5484b79b746af2.tar.gz |
Improve plausibility check in sctp_handle_sack().
Allow cmt_on_off to support values 0 (no CMT), 1 (CMT), and 2 (CMT/RP).
MFC after: 3 months.
Diffstat (limited to 'sys/netinet/sctp_cc_functions.c')
-rw-r--r-- | sys/netinet/sctp_cc_functions.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/sys/netinet/sctp_cc_functions.c b/sys/netinet/sctp_cc_functions.c index b7b4118..c7a2415 100644 --- a/sys/netinet/sctp_cc_functions.c +++ b/sys/netinet/sctp_cc_functions.c @@ -80,12 +80,12 @@ sctp_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_nets *net; /*- - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* @@ -250,7 +250,7 @@ sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -274,10 +274,9 @@ sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -296,7 +295,7 @@ sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { /* If the cumulative ack moved we can proceed */ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ @@ -759,12 +758,12 @@ sctp_hs_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_nets *net; /* - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* @@ -917,7 +916,7 @@ sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb, * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -937,10 +936,9 @@ sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb, * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -959,7 +957,7 @@ sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb, * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { /* If the cumulative ack moved we can proceed */ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ @@ -1403,7 +1401,7 @@ sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb, * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -1423,10 +1421,9 @@ sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb, * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -1445,7 +1442,7 @@ sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb, * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { htcp_cong_avoid(stcb, net); measure_achieved_throughput(stcb, net); } else { @@ -1481,12 +1478,12 @@ sctp_htcp_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_nets *net; /* - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* |