diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-11-27 12:25:10 -0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-02 21:30:37 -0800 |
commit | 91cf5a17257e1d2ef936fbf0223c3436ca583af9 (patch) | |
tree | eb7386ab5729d299bda6534c783378eb3fd73c4c | |
parent | f5c2d6367b04fd5ba98a5f9846b5fb870423968a (diff) | |
download | linux-3.10-91cf5a17257e1d2ef936fbf0223c3436ca583af9.tar.gz linux-3.10-91cf5a17257e1d2ef936fbf0223c3436ca583af9.tar.bz2 linux-3.10-91cf5a17257e1d2ef936fbf0223c3436ca583af9.zip |
[DCCP] ccid3: Fix calculation of t_ipi time of scheduled transmission
Problem:
-rw-r--r-- | net/dccp/ccids/ccid3.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index df88c54b2ec..fb1a5e89c02 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c @@ -304,11 +304,19 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, break; case TFRC_SSTATE_NO_FBACK: case TFRC_SSTATE_FBACK: - delay = (timeval_delta(&now, &hctx->ccid3hctx_t_nom) - - hctx->ccid3hctx_delta); - delay /= -1000; - /* divide by -1000 is to convert to ms and get sign right */ - rc = delay > 0 ? delay : 0; + delay = timeval_delta(&hctx->ccid3hctx_t_nom, &now); + /* + * Scheduling of packet transmissions [RFC 3448, 4.6] + * + * if (t_now > t_nom - delta) + * // send the packet now + * else + * // send the packet in (t_nom - t_now) milliseconds. + */ + if (delay < hctx->ccid3hctx_delta) + rc = 0; + else + rc = delay/1000L; break; case TFRC_SSTATE_TERM: DCCP_BUG("Illegal %s state TERM, sk=%p", dccp_role(sk), sk); |