diff options
author | Martin Willi <martin@strongswan.org> | 2009-08-31 17:59:00 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-08-31 18:00:28 +0200 |
commit | 6180a55852afaf7fee4086a45dccbff9d7f7dfa8 (patch) | |
tree | 61968edccb4b5b5e39a045b16067299f1e5cda02 /src/charon/network | |
parent | de5784452b31af3c7342269127a12d352edc0b4e (diff) | |
download | strongswan-6180a55852afaf7fee4086a45dccbff9d7f7dfa8.tar.bz2 strongswan-6180a55852afaf7fee4086a45dccbff9d7f7dfa8.tar.xz |
use time_monotonic() instead of time() for statistics and time difference calculations
Diffstat (limited to 'src/charon/network')
-rw-r--r-- | src/charon/network/receiver.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/charon/network/receiver.c b/src/charon/network/receiver.c index ab4d6d592..5c24a6270 100644 --- a/src/charon/network/receiver.c +++ b/src/charon/network/receiver.c @@ -168,7 +168,7 @@ static bool cookie_verify(private_receiver_t *this, message_t *message, chunk_t reference; chunk_t secret; - now = time(NULL); + now = time_monotonic(NULL); t = *(u_int32_t*)cookie.ptr; if (cookie.len != sizeof(u_int32_t) + @@ -296,9 +296,9 @@ static job_requeue_t receive_packets(private_receiver_t *this) /* check for cookies */ if (this->cookie_threshold && cookie_required(this, message)) { - u_int32_t now = time(NULL); + u_int32_t now = time_monotonic(NULL); chunk_t cookie = cookie_build(this, message, now - this->secret_offset, - chunk_from_thing(this->secret)); + chunk_from_thing(this->secret)); DBG2(DBG_NET, "received packet from: %#H to %#H", message->get_source(message), @@ -352,7 +352,7 @@ static void destroy(private_receiver_t *this) receiver_t *receiver_create() { private_receiver_t *this = malloc_thing(private_receiver_t); - u_int32_t now = time(NULL); + u_int32_t now = time_monotonic(NULL); this->public.destroy = (void(*)(receiver_t*)) destroy; |