From a2c15b17c3848592b0a6be783bffa641cf7153ff Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Sun, 19 Aug 2007 17:18:33 -0700 Subject: [PATCH] --- yaml --- r: 66295 b: refs/heads/master c: 19ac21465e15e476220909c01b23df847b6ffa30 h: refs/heads/master i: 66293: fb090074692f9aca5cd206c7efa91110502c4221 66291: aa8b529d35c5261fd75f51b0e1a760eeb21c50df 66287: a03a26ffa0776e213d2ac5ae05b7feb82f288c08 v: v3 --- [refs] | 2 +- trunk/include/linux/dccp.h | 3 ++- trunk/net/dccp/options.c | 13 +++++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index d9420624b688..af22ec79bbc4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0740d49c2465bdd2644455c4bc49794395b73433 +refs/heads/master: 19ac21465e15e476220909c01b23df847b6ffa30 diff --git a/trunk/include/linux/dccp.h b/trunk/include/linux/dccp.h index fda2148d8c85..3a4b96becfc4 100644 --- a/trunk/include/linux/dccp.h +++ b/trunk/include/linux/dccp.h @@ -215,6 +215,7 @@ struct dccp_so_feat { #ifdef __KERNEL__ #include +#include #include #include #include @@ -498,7 +499,7 @@ struct dccp_sock { __u64 dccps_gar; __be32 dccps_service; struct dccp_service_list *dccps_service_list; - struct timeval dccps_timestamp_time; + ktime_t dccps_timestamp_time; __u32 dccps_timestamp_echo; __u16 dccps_l_ack_ratio; __u16 dccps_r_ack_ratio; diff --git a/trunk/net/dccp/options.c b/trunk/net/dccp/options.c index 34d536d5f1a1..95b75d8354ff 100644 --- a/trunk/net/dccp/options.c +++ b/trunk/net/dccp/options.c @@ -158,7 +158,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb) opt_recv->dccpor_timestamp = ntohl(*(__be32 *)value); dp->dccps_timestamp_echo = opt_recv->dccpor_timestamp; - dccp_timestamp(sk, &dp->dccps_timestamp_time); + dp->dccps_timestamp_time = ktime_get_real(); dccp_pr_debug("%s rx opt: TIMESTAMP=%u, ackno=%llu\n", dccp_role(sk), opt_recv->dccpor_timestamp, @@ -405,14 +405,12 @@ static int dccp_insert_option_timestamp_echo(struct sock *sk, struct sk_buff *skb) { struct dccp_sock *dp = dccp_sk(sk); - struct timeval now; __be32 tstamp_echo; - u32 elapsed_time; int len, elapsed_time_len; unsigned char *to; - - dccp_timestamp(sk, &now); - elapsed_time = timeval_delta(&now, &dp->dccps_timestamp_time) / 10; + const suseconds_t delta = ktime_us_delta(ktime_get_real(), + dp->dccps_timestamp_time); + u32 elapsed_time = delta / 10; elapsed_time_len = dccp_elapsed_time_len(elapsed_time); len = 6 + elapsed_time_len; @@ -438,8 +436,7 @@ static int dccp_insert_option_timestamp_echo(struct sock *sk, } dp->dccps_timestamp_echo = 0; - dp->dccps_timestamp_time.tv_sec = 0; - dp->dccps_timestamp_time.tv_usec = 0; + dp->dccps_timestamp_time = ktime_set(0, 0); return 0; }