summaryrefslogtreecommitdiffstats
path: root/src/methods/common.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-01-26 06:00:04 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-01-26 06:00:04 +0100
commit26cf96bea0e07df934c807b78c2d77383556c1ce (patch)
treefffd28e2ea258df38422dcdfe169b9a4b3b27049 /src/methods/common.c
parent76d955efa5fcd46fd325015d6cd3a389f8d9bb93 (diff)
downloadfastd-26cf96bea0e07df934c807b78c2d77383556c1ce.tar
fastd-26cf96bea0e07df934c807b78c2d77383556c1ce.zip
Switch to the new timeout helpers where possible
Diffstat (limited to 'src/methods/common.c')
-rw-r--r--src/methods/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/methods/common.c b/src/methods/common.c
index 75a61b3..32e827c 100644
--- a/src/methods/common.c
+++ b/src/methods/common.c
@@ -57,7 +57,7 @@ bool fastd_method_is_nonce_valid(fastd_context_t *ctx, const fastd_method_common
*age >>= 1;
if (*age >= 0) {
- if (timespec_diff(&ctx->now, &session->receive_last) > (int)ctx->conf->reorder_time*1000)
+ if (fastd_timed_out(ctx, &session->reorder_timeout))
return false;
if (*age > 64)
@@ -79,7 +79,7 @@ bool fastd_method_reorder_check(fastd_context_t *ctx, fastd_peer_t *peer, fastd_
session->receive_reorder_seen |= (1 << (shift-1));
memcpy(session->receive_nonce, nonce, COMMON_NONCEBYTES);
- session->receive_last = ctx->now;
+ session->reorder_timeout = fastd_in_seconds(ctx, ctx->conf->reorder_time);
return true;
}
else if (age == 0 || session->receive_reorder_seen & (1 << (age-1))) {