aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/options.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-08-27 18:18:18 -0300
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 16:11:56 -0700
commitb6ee3d4ada4e85d9b9b9164c1327ef0850c79d5e (patch)
tree26dfc68ab042ebb8186fe3a93a34723cb1faaae1 /net/dccp/options.c
parent1f2333aea3269e196c44ae9a220e714cc1427792 (diff)
downloadkernel_samsung_smdk4412-b6ee3d4ada4e85d9b9b9164c1327ef0850c79d5e.zip
kernel_samsung_smdk4412-b6ee3d4ada4e85d9b9b9164c1327ef0850c79d5e.tar.gz
kernel_samsung_smdk4412-b6ee3d4ada4e85d9b9b9164c1327ef0850c79d5e.tar.bz2
[CCID3]: Reorganise timeval handling
Introducing functions to add to or subtract from a timeval variable and renaming now_delta to timeval_new_delta that calls do_gettimeofday and then timeval_delta, that should be used when there are several deltas made relative to the current time or setting variables to it, so as to avoid calling do_gettimeofday excessively. I'm leaving these "timeval_" prefixed funcions internal to DCCP for a while till we're sure there are no subtle bugs in it. It also is more correct as it checks if the number of usecs added to or subtracted from a tv_usec field is more than 2 seconds. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/options.c')
-rw-r--r--net/dccp/options.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c
index eabcc8f..382c589 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -359,7 +359,7 @@ static void dccp_insert_option_ack_vector(struct sock *sk, struct sk_buff *skb)
#endif
struct dccp_ackpkts *ap = dp->dccps_hc_rx_ackpkts;
int len = ap->dccpap_buf_vector_len + 2;
- const u32 elapsed_time = now_delta(ap->dccpap_time) / 10;
+ const u32 elapsed_time = timeval_now_delta(&ap->dccpap_time) / 10;
unsigned char *to, *from;
if (elapsed_time != 0)
@@ -451,7 +451,8 @@ static void dccp_insert_option_timestamp_echo(struct sock *sk,
"CLIENT TX opt: " : "server TX opt: ";
#endif
u32 tstamp_echo;
- const u32 elapsed_time = now_delta(dp->dccps_timestamp_time) / 10;
+ const u32 elapsed_time =
+ timeval_now_delta(&dp->dccps_timestamp_time) / 10;
const int elapsed_time_len = dccp_elapsed_time_len(elapsed_time);
const int len = 6 + elapsed_time_len;
unsigned char *to;