summaryrefslogtreecommitdiffstats
path: root/src/methods/common.c
diff options
context:
space:
mode:
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))) {