]> git.meshlink.io Git - meshlink/blobdiff - src/net.c
When resetting timers that use CLOCK_MONOTONIC, use a negative value.
[meshlink] / src / net.c
index 0aa20439a87de39d518cb130d7c7d4852be27d9f..cfb4d1775412db4b040b4824b39295a0fdbb2e72 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -632,7 +632,7 @@ static void periodic_handler(event_loop_t *loop, void *data) {
                                n->status.validkey = false;
                                sptps_stop(&n->sptps);
                                n->status.waitingforkey = false;
-                               n->last_req_key = 0;
+                               n->last_req_key = -3600;
                        } else {
                                n->last_req_key = mesh->loop.now.tv_sec;
                        }
@@ -671,7 +671,7 @@ void retry(meshlink_handle_t *mesh) {
                }
 
                if(!c->status.pinged) {
-                       c->last_ping_time = 0;
+                       c->last_ping_time = -3600;
                }
 
                sockaddr_t sa;