summaryrefslogtreecommitdiff
path: root/src/ot_udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ot_udp.c')
-rw-r--r--src/ot_udp.c4
1 files changed, 2 insertions, 2 deletions
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
39 int i; 39 int i;
40 uint32_t current_key_of_the_hour; 40 uint32_t current_key_of_the_hour;
41 41
42 if (time_now_minutes() - g_hour_of_the_key >= 60) { 42 if (time_since_minutes(g_hour_of_the_key) >= 60) {
43 uint32_t old_key_of_the_hour = g_key_of_the_hour[0]; 43 uint32_t old_key_of_the_hour = g_key_of_the_hour[0];
44 uint32_t new_key_of_the_hour = random_uint32(); 44 uint32_t new_key_of_the_hour = random_uint32();
45 /* If in the meantime another thread has performed 45 /* If in the meantime another thread has performed
46 key rotation, do not overwrite their results */ 46 key rotation, do not overwrite their results */
47 if (time_now_minutes() - g_hour_of_the_key >= 60) { 47 if (time_since_minutes(g_hour_of_the_key) >= 60) {
48 /* Upgrade en bloc */ 48 /* Upgrade en bloc */
49 g_hour_of_the_key = time_now_minutes(); 49 g_hour_of_the_key = time_now_minutes();
50 g_key_of_the_hour[0] = new_key_of_the_hour; 50 g_key_of_the_hour[0] = new_key_of_the_hour;