Update "now" after connect() when making outgoing connections.
[tinc] / src / net_socket.c
index cb27106..c167c2f 100644 (file)
@@ -457,8 +457,11 @@ begin:
                freeaddrinfo(proxyai);
        }
 
                freeaddrinfo(proxyai);
        }
 
+       now = time(NULL);
+
        if(result == -1) {
                if(sockinprogress(sockerrno)) {
        if(result == -1) {
                if(sockinprogress(sockerrno)) {
+                       c->last_ping_time = now;
                        c->status.connecting = true;
                        return;
                }
                        c->status.connecting = true;
                        return;
                }