From 47293a4f116e04a88b0797bafad0c98b4393b744 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Thu, 5 Nov 2026 13:52:17 +0100 Subject: Clamp every elapsed time span at zero, using a set of helper functions --- src/ot_udp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ot_udp.c') diff --git a/src/ot_udp.c b/src/ot_udp.c index 644b71d..e67ca1f 100644 --- a/src/ot_udp.c +++ b/src/ot_udp.c @@ -39,12 +39,12 @@ static void udp_make_connectionid(uint32_t connid[2], const ot_ip6 remoteip, int int i; uint32_t current_key_of_the_hour; - if (time_now_minutes() - g_hour_of_the_key >= 60) { + if (time_since_minutes(g_hour_of_the_key) >= 60) { uint32_t old_key_of_the_hour = g_key_of_the_hour[0]; uint32_t new_key_of_the_hour = random_uint32(); /* If in the meantime another thread has performed key rotation, do not overwrite their results */ - if (time_now_minutes() - g_hour_of_the_key >= 60) { + if (time_since_minutes(g_hour_of_the_key) >= 60) { /* Upgrade en bloc */ g_hour_of_the_key = time_now_minutes(); g_key_of_the_hour[0] = new_key_of_the_hour; -- cgit v1.3