diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-06-11 06:19:09 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-06-11 06:19:09 -0400 |
commit | 3294f202dc1acd82223e83ef59f272bd87bb06b2 (patch) | |
tree | b3841a093322afbc7cd608ccc6ae60debe8c015a /net/dccp | |
parent | 513fd370e6832f81ab717df4645f5ce679e44f14 (diff) |
dccp ccid-3: Bug-Fix - Zero RTT is possible
In commit $(825de27d9e40b3117b29a79d412b7a4b78c5d815) (from 27th May, commit
message `dccp ccid-3: Fix "t_ipi explosion" bug'), the CCID-3 window counter
computation was fixed to cope with RTTs < 4 microseconds.
Such RTTs can be found e.g. when running CCID-3 over loopback. The fix removed
a check against RTT < 4, but introduced a divide-by-zero bug.
All steady-state RTTs in DCCP are filtered using dccp_sample_rtt(), which
ensures non-zero samples. However, a zero RTT is possible on initialisation,
when there is no RTT sample from the Request/Response exchange.
The fix is to use the fallback-RTT from RFC 4340, 3.4.
This is also better than just fixing update_win_count() since it allows other
parts of the code to always assume that the RTT is non-zero during the time
that the CCID is used.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index f813077234b7..0474f4c5707a 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -329,8 +329,14 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb) | |||
329 | hctx->ccid3hctx_x = rfc3390_initial_rate(sk); | 329 | hctx->ccid3hctx_x = rfc3390_initial_rate(sk); |
330 | hctx->ccid3hctx_t_ld = now; | 330 | hctx->ccid3hctx_t_ld = now; |
331 | } else { | 331 | } else { |
332 | /* Sender does not have RTT sample: X_pps = 1 pkt/sec */ | 332 | /* |
333 | hctx->ccid3hctx_x = hctx->ccid3hctx_s; | 333 | * Sender does not have RTT sample: |
334 | * - set fallback RTT (RFC 4340, 3.4) since a RTT value | ||
335 | * is needed in several parts (e.g. window counter); | ||
336 | * - set sending rate X_pps = 1pps as per RFC 3448, 4.2. | ||
337 | */ | ||
338 | hctx->ccid3hctx_rtt = DCCP_FALLBACK_RTT; | ||
339 | hctx->ccid3hctx_x = hctx->ccid3hctx_s; | ||
334 | hctx->ccid3hctx_x <<= 6; | 340 | hctx->ccid3hctx_x <<= 6; |
335 | } | 341 | } |
336 | ccid3_update_send_interval(hctx); | 342 | ccid3_update_send_interval(hctx); |