diff options
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 86c109e2f2cd..0804b3e435c8 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -962,7 +962,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
962 | struct dccp_rx_hist_entry *packet; | 962 | struct dccp_rx_hist_entry *packet; |
963 | struct timeval now; | 963 | struct timeval now; |
964 | u8 win_count; | 964 | u8 win_count; |
965 | u32 p_prev; | 965 | u32 p_prev, r_sample, t_elapsed; |
966 | int ins; | 966 | int ins; |
967 | 967 | ||
968 | if (hcrx == NULL) | 968 | if (hcrx == NULL) |
@@ -982,9 +982,23 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
982 | break; | 982 | break; |
983 | p_prev = hcrx->ccid3hcrx_rtt; | 983 | p_prev = hcrx->ccid3hcrx_rtt; |
984 | do_gettimeofday(&now); | 984 | do_gettimeofday(&now); |
985 | hcrx->ccid3hcrx_rtt = timeval_usecs(&now) - | 985 | timeval_sub_usecs(&now, opt_recv->dccpor_timestamp_echo * 10); |
986 | (opt_recv->dccpor_timestamp_echo - | 986 | r_sample = timeval_usecs(&now); |
987 | opt_recv->dccpor_elapsed_time) * 10; | 987 | t_elapsed = opt_recv->dccpor_elapsed_time * 10; |
988 | |||
989 | if (unlikely(r_sample <= t_elapsed)) | ||
990 | LIMIT_NETDEBUG(KERN_WARNING | ||
991 | "%s: r_sample=%uus, t_elapsed=%uus\n", | ||
992 | __FUNCTION__, r_sample, t_elapsed); | ||
993 | else | ||
994 | r_sample -= t_elapsed; | ||
995 | |||
996 | if (hcrx->ccid3hcrx_state == TFRC_RSTATE_NO_DATA) | ||
997 | hcrx->ccid3hcrx_rtt = r_sample; | ||
998 | else | ||
999 | hcrx->ccid3hcrx_rtt = (hcrx->ccid3hcrx_rtt * 9) / 10 + | ||
1000 | r_sample / 10; | ||
1001 | |||
988 | if (p_prev != hcrx->ccid3hcrx_rtt) | 1002 | if (p_prev != hcrx->ccid3hcrx_rtt) |
989 | ccid3_pr_debug("%s, New RTT=%luus, elapsed time=%u\n", | 1003 | ccid3_pr_debug("%s, New RTT=%luus, elapsed time=%u\n", |
990 | dccp_role(sk), hcrx->ccid3hcrx_rtt, | 1004 | dccp_role(sk), hcrx->ccid3hcrx_rtt, |