diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-12-09 21:01:22 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-11 17:34:41 -0500 |
commit | 179ebc9f92da88e15ea86d7d27308c92712d8ee9 (patch) | |
tree | 6b8a18fd9e5b3447b8b32560d258f92276c358b7 /net/dccp | |
parent | ff58629824c068e2a75402b5b83f12af0b36d394 (diff) |
[DCCP] ccid3: Fix two bugs in sending rate computation
This fixes
1) a bug in the recomputation of the sending rate by the nofeedback
timer when no feedback at all has so far been sent by the receiver:
min_t was used instead of max_t, which is wrong (cf. RFC 3448, p. 10);
2) an error in the computation of larger initial windows: instead of
min(... max()) (cf. RFC 4342, 5.), the code had used max(... max()).
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 92e893ee77c2..c54663f21fdd 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -193,7 +193,7 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data) | |||
193 | switch (hctx->ccid3hctx_state) { | 193 | switch (hctx->ccid3hctx_state) { |
194 | case TFRC_SSTATE_NO_FBACK: | 194 | case TFRC_SSTATE_NO_FBACK: |
195 | /* RFC 3448, 4.4: Halve send rate directly */ | 195 | /* RFC 3448, 4.4: Halve send rate directly */ |
196 | hctx->ccid3hctx_x = min_t(u32, hctx->ccid3hctx_x / 2, | 196 | hctx->ccid3hctx_x = max_t(u32, hctx->ccid3hctx_x / 2, |
197 | hctx->ccid3hctx_s / TFRC_T_MBI); | 197 | hctx->ccid3hctx_s / TFRC_T_MBI); |
198 | 198 | ||
199 | ccid3_pr_debug("%s, sk=%p, state=%s, updated tx rate to %d " | 199 | ccid3_pr_debug("%s, sk=%p, state=%s, updated tx rate to %d " |
@@ -477,7 +477,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
477 | if (hctx->ccid3hctx_state == TFRC_SSTATE_NO_FBACK) { | 477 | if (hctx->ccid3hctx_state == TFRC_SSTATE_NO_FBACK) { |
478 | /* Use Larger Initial Windows [RFC 4342, sec. 5] | 478 | /* Use Larger Initial Windows [RFC 4342, sec. 5] |
479 | * We deviate in that we use `s' instead of `MSS'. */ | 479 | * We deviate in that we use `s' instead of `MSS'. */ |
480 | u16 w_init = max( 4 * hctx->ccid3hctx_s, | 480 | u16 w_init = min( 4 * hctx->ccid3hctx_s, |
481 | max(2 * hctx->ccid3hctx_s, 4380)); | 481 | max(2 * hctx->ccid3hctx_s, 4380)); |
482 | hctx->ccid3hctx_rtt = r_sample; | 482 | hctx->ccid3hctx_rtt = r_sample; |
483 | hctx->ccid3hctx_x = usecs_div(w_init, r_sample); | 483 | hctx->ccid3hctx_x = usecs_div(w_init, r_sample); |